Add to Favorites

[Total: 0    Average: 0/5]

This shows how to have both a HREF and an IMAGE click to add the url to the favorites.

Body Code:

<Img  onclick="window.external.AddFavorite('http://www.js-examples.com/','JavaScript Examples');this.style.behavior='url(#default#site)';" 
      src="http://www.js-examples.com/js/pic1.gif" style="CURSOR: hand"> 

<script>
if(navigator.appName=="Microsoft Internet Explorer")
{
jav='window.external.AddFavorite("http://www.js-examples.com/","JavaScript%20Examples")' 
document.write("<a href=javascript:"+jav+">")
document.write("Add to Favorites"+"</a>")
}
</script>

Times Viewed: 2

Leave a Reply

Your email address will not be published. Required fields are marked *