magento网站添加收藏按钮

代码如下:
[php]
<script language="javascript">
function addfavor(url,title) {
if(confirm("website:"+title+"\nUrl:"+url+"\n Determine?")){
var ua = navigator.userAgent.toLowerCase();
if(ua.indexOf("msie 8")>-1){
external.AddToFavoritesBar(url,title,”);//IE8
}else{
try {
window.external.addFavorite(url, title);
} catch(e) {
try {
window.sidebar.addPanel(title, url, "");//firefox
} catch(e) {
alert("error");
}
}
}
}
return false;
}
</script>

<a href="javascript:;" onclick="javascript:addfavor(‘http://www.baymal.com’,”);">add to Favorite</a>
[/php]

标签