ie 홈 페이지와 책갈피 원본 설정

1398 단어
<a href="http://www.162100.com" onclick="addFavor();return(false);"> </a><br />
<a href="#" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.162100.com/');return(false);"> 162100 </a>


//js 
function getCookie(name){
  var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
  if(arr != null) return unescape(arr[2]); return null;
}

function addFavor(){
  var thisTitle='162100 -   -  ';
  var thisUrl='http://www.162100.com/';
  if(document.all){
    window.external.AddFavorite(thisUrl,thisTitle);
  }else if(window.sidebar){
    window.sidebar.addPanel(thisTitle,thisUrl,"");
  return false;
  }
}

function SetHome(obj,vrl){
  try{
    obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
  }catch(e){
    if(window.netscape){
      try{
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      }catch(e){
        alert(" !
“about:config”
[signed.applets.codebase_principal_support] 'true'");        }       var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);       prefs.setCharPref('browser.startup.homepage',vrl);     }   } }

좋은 웹페이지 즐겨찾기