- <script>
- function addFav(){
- if(document.all){
- window.external.addFavorite(‘http://www.35dalu.com/‘,‘商务大陆网‘);
- }else if(window.sidebar){
- window.sidebar.addPanel(‘商务大陆网‘, ‘http://www.35dalu.com/‘,‘‘);
- }
- }
- </script>
- <a href="#" title="test" rel="sidebar" onclick="addFav();">收藏</a></div>
如果 <a>上面没有加 “rel=sidebar” ,那么将会报错: window.sidebar.addPanel is not a function (by default7#zbphp.com)
javascript 加入收藏夹 ,兼容IE firefox chrome ,解决 window.sidebar.addPanel is not a function,布布扣,bubuko.com
javascript 加入收藏夹 ,兼容IE firefox chrome ,解决 window.sidebar.addPanel is not a function