Copy codeThe Code is as follows:
Var www_jb51_net = function (obj, url, title ){
Var e = window. event | arguments. callee. caller. arguments [0];
Var B = {
IE:/MSIE/. test (window. navigator. userAgent )&&! Window. opera
, FF:/Firefox/. test (window. navigator. userAgent)
, OP :!! Window. opera
};
Obj. onmousedown = null;
If (B. IE ){
Obj. attachEvent ("onmouseup", function (){
Try {
Window. external. AddFavorite (url, title );
Window. event. returnValue = false;
} Catch (exp ){}
});
} Else {
If (B. FF | obj. nodeName. toLowerCase () = ""){
Obj. setAttribute ("rel", "sidebar"), obj. title = title, obj. href = url;
} Else if (B. OP ){
Var a = document. createElement ("");
A. rel = "sidebar", a. title = title, a. href = url;
Obj. parentNode. insertBefore (a, obj );
A. appendChild (obj );
A = null;
}
}
};
<A href = "javascript: void (0); return false;" onMouseDown = "www_jb51_net (this, 'HTTP: // www.jb51.net ', 'foothome is a professional Chinese website construction resource and Script Programming learning website') "> favorites foothome </a>