一个很简单的Javascript问题(在线等) javascript(关闭网页时弹出设为首页这个效果),怎么写?要求能正常运行的,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Javascript设为首页代码可以将网站设置为首页,此代码兼容IE及Firefox come from http://www.5djava.com/ function addHome() { if (window.sidebar) { try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为true"); } var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService( Components.interfaces.nsIPrefBranch ); prefs.setCharPref("browser.startup.homepage",'http://www.phpuu.com/'); } else if(document.all) { document.body.style.behavior="url(#default#homepage)"; document.body.setHomePage('http://www.phpuu.com/'); } else { ; } } 调用方式: <a href="javascript:addHome();">设为首页</a> 参考这个http://www.tinybbs.cn/js/post/id~15228我也没试过 js的一个问题 关于隐藏后的宽度计算问题 怎么在更多下,加一个类似下拉框的效果? 怎样确定表格中的一行 当鼠标放到一个链接上时如何在旁边显示一些提示信息?向下面的链接那样 请问javascript 如何操作 ppt 让它翻页? ***没有人对web菜单感兴趣吗*** 最好的web菜单,竟然存在严重的BUG,急着等米下锅,请版主和菜单高手关注 [原创]业余时间写的一个飞行射击游戏 编辑框内容同步,新手求解答 Error: Cannot find module 'extract-text-webpack-plugin' javascript(关闭网页时弹出设为首页效果) 求教一个问题!!
come from http://www.5djava.com/
function addHome()
{
if (window.sidebar)
{
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e)
{
alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为true");
} var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService( Components.interfaces.nsIPrefBranch );
prefs.setCharPref("browser.startup.homepage",'http://www.phpuu.com/');
}
else if(document.all)
{
document.body.style.behavior="url(#default#homepage)";
document.body.setHomePage('http://www.phpuu.com/');
}
else
{
;
}
}
调用方式: <a href="javascript:addHome();">设为首页</a>
我也没试过