Once upon a time, used to join the collection code, but not compatible with Firefox, a bit depressed, at this point, there is a compatible version of the Code, published as follows:
Compatible with Firefox (version: Firefox 3.6.3), Ie6/ie7/ie8 to join the collection code, online some test time did not pass, the following no problem.
<script>
Get URL address favorites compatible FF
function Shoucang (title,geturl) {
Title=document.title;
Geturl=document.location.href;
if (document.all) {
Window.external.addFavorite (Geturl,title);
}
else if
(Window.sidebar)
{
Window.sidebar.addPanel (Title, Geturl, "");
}
}
</script>
Reference
', ' news-<%=id%> HTML '); />
or direct reference (remove//comment in function to take the initiative to get the address)
Set homepage, compatible with Firefox is more difficult here is Tencent QQ set as the homepage code, you can refer to, most of the can only do this look
<script>
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 ("Sorry.") Your browser does not support setting the homepage directly. Please enter "About:config" in the browser address bar and return to the [Signed.applets.codebase_principal_support] set to "true", click "Add Favorites" and ignore the security prompts to set success. ");
}
var prefs = components.classes[' @mozilla. Org/preferences-service;1 '].getservice ( Components.interfaces.nsIPrefBranch);
Prefs.setcharpref (' Browser.startup.homepage ', VRL);
}
}
}
</script>
<a href= "javascript:void (0)" onclick= "Sethome (this,window.location)" target= "_top" > Set as Homepage </a>