function addFavorite(obj, opts){ var _t, _u; if(typeof opts != 'object'){ _t = document.title; _u = location.href; }else{ _t = opts.title || document.title; _u = opts.url || location.href; }try{ window.external.addFavorite(_u, _t); }catch(e){ if(window.sidebar){ obj.href = _u; obj.title = _t; obj.rel = 'sidebar'; }else{ alert('抱歉,您所使用的浏览器无法完成此操作。请使用 Ctrl + D 将本页加入收藏夹!'); } }}
]]>原创文章,作者:键盘游走者,如若转载,请注明出处:http://www.708034.com/2017/01/%e6%94%af%e6%8c%81%e7%81%ab%e7%8b%90%e5%8a%a0%e5%85%a5%e6%94%b6%e8%97%8f%e5%a4%b9/