读书人

“保藏本站” 的代码

发布时间: 2012-11-23 00:03:43 作者: rapoo

“收藏本站” 的代码

网上很多的代码只能在IE中,这个代码能够在 IE 和火狐浏览器中通用。

?

<script type="text/javascript">  function addFavorite() {       var c = "http://sise.sinaapp.com/";       var b = "华软微博";       try {           window.external.AddFavorite(c, b)       } catch (d) {           window.sidebar.addPanel(b, c, "")       }   };  </script> 

?

html 代码为:

?

<!-----------By Amolee---------添加收藏----------------------><a href='#' onClick="addFavorite();">收藏本站</a>

?

效果见:http://sise.sinaapp.com/

?

?

读书人网 >Web前端

热点推荐