JS实现设为首页与加入收藏】的更多相关文章

<script type="text/javascript"> // 设置为主页 function SetHome(obj, vrl) { try { obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(vrl); } catch (e) { if (window.netscape) { try { netscape.security.PrivilegeManager.enablePrivilege(…
// JavaScript Document // 加入收藏 <a onclick="AddFavorite(window.location,document.title)">加入收藏</a> function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle…
//  加入收藏 <a onclick="AddFavorite(window.location,document.title)">加入收藏</a>function AddFavorite(sURL, sTitle) {    try {        window.external.addFavorite(sURL, sTitle);    }    catch (e) {        try {            window.sidebar.addP…
<script  type="text/javascript"> //设为首页 function SetHome(obj,url){     try{         obj.style.behavior='url(#default#homepage)';         obj.setHomePage(url);     }catch(e){         if(window.netscape){             try{                 net…
设为首页,添加到收藏夹 分享自:http://my.oschina.net/lyx2012/blog/60036 设为首页 和 收藏本站js代码 兼容IE,chrome,ff <script type="text/javascript"> //设为首页 function SetHome(obj,url){ try{ obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url); }catch(e){ if…
其实不少非IE内核浏览器都仍不支持通过代码将网页设为主页和加入收藏的功能,因此说是兼容,其实只是一个try,catch后的提醒而已. 加入收藏: /* * author : 2010-12-27 11:33:02 teresa * discription: add favorite */ function addFavorite() { if(document.all) { try { window.external.addFavorite(window.location.href, docum…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <style type="text/css"> *{margin: 0; padding: 0} a{text-decoration: none; color: #fff; font-size…
// JavaScript Document // 加入收藏 <a onclick="AddFavorite(window.location,document.title)">加入收藏</a> function AddFavorite(sURL, sTitle) { try { window.external.addFavorite(sURL, sTitle); } catch (e) { try { window.sidebar.addPanel(sTitle…
// JavaScript Document// 加入收藏 < a onclick="AddFavorite(window.location,document.title)" >加入收藏< /a> function AddFavorite(sURL, sTitle){    try    {        window.external.addFavorite(sURL, sTitle);    }    catch (e)    {        try   …
(特别注意:要把'这个符号换成无任何输入法状态中输入的'这个符号,否则程序无法运行)   1.文字型:     <a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.apple-wallpaper.com');" href="http://www.apple-wallpaper.com">设为首页</a> 2.按钮型:    …