Creating Add to Favorites link and script in JavaScript
Sponsored Links
Do you see an "Add to Favorites" lin on the right of this page? When you click on this link, the "Favorites" window pop-ups asking if you would like to add the site to the list.
Let us first see the advantages of adding such a link:
If visitors really like your site, they can easily add it to their favorites list through the normal process - Under Internet Explorer, click on the "Favorites" menu item and then on "Add to Favorites...".
However, they might just forget about this or they just might feel lazy (...you now what I mean). If you have an "Add To Favorites" link, you not only remind the visitors of the favorites folder but also prompt them to add your site and this just takes one click.
Here we use a little JavaScript and tie it up to the HREF tag of the link and here is the JavaScript function code:
function addfav()
{
if (document.all)
{
window.external.AddFavorite
("http://www.webdevelopersnotes.com","WebDevelopersNotes")
}
}
Note: The javascript statement "window.external.AddFavorite(..." should be a single line
The part in red color in the above code is the URL and the blue is the Name you want to give to the link.
The function can be placed inside the document head or an external .js file and will be called from the link as:
<a href="javascript:addfav()">Add To Favorites</a>
This creates a link like - Add To Favorites
Page contents: Creating Add to Favorites function using JavaScript code that helps visitors add your site quickly to their Favorites folder.
Comments, questions, feedback... whatever!
Recent Articles
Recent Blog Posts
Popular Articles
- Hotmail Sign In page
- Create a Hotmail account - Instructions
- Create Gmail address
- Download and install Outlook Express
- Get your free Gmail address
- Outlook Express new version
- Create my own email address
- Browers for Windows list
- Get email address
- Color combinations for web sites and pages
- Create Yahoo ID
More web tips & tricks
- Outlook Express Help - tips & tricks (53)
- Windows Live Mail help and tips (36)
- Windows Mail help (25)
- Hotmail help and tips (42)
- Yahoo help & support (45)
- AOL email help (26)
- Gmail help and tips (36)
- Internet tips & tricks (12)
- Web Design tips & tricks (33)
- HTML, Javascript tips tricks (68)
- Web Promotion tips & tricks (8)
- Graphics tips & tricks (20)
