IE FF 를 호 환 할 수 있 는 홈 페이지 와 컬 렉 션 구현 코드


<script type="text/javascript">
function addCookie()
{
if (document.all)
{
window.external.addFavorite('https://www.jb51.net',' ');
}
else if (window.sidebar)
{
window.sidebar.addPanel(' ', 'https://www.jb51.net', "");
}
}

function setHomepage()
{
if (document.all)
{
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('https://www.jb51.net');

}
else if (window.sidebar)
{
if(window.netscape)
{
try
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e)
{

}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage','https://www.jb51.net');
}
}
</script>

<form>
<a href="#" onclick="return setHomepage();"> </a>
<a href="#" onclick="return addCookie();"> </a>
</form>

좋은 웹페이지 즐겨찾기