给magento添加添加到收藏夹的按钮的代码如下:

 

<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.magentouse.com','');">add to Favorite</a>