« Enable curl with XAMPP on Windows XP | Main | X-Men Legends 2: Rise of Apocalypse »

Adding Bookmark This link to your website using javascript

Home » Programming » Javascript

We could easily add a bookmark this site link or add to your favorite sites link using javascript by adding the following code to your website:

<script language="javascript">
function addBookmark()
{
bookmarkurl = "http://www.tildemark.com";
bookmarktitle="Tildemark blogs";
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
else if ( window.sidebar ) {
window.sidebar.addPanel(bookmarktitle, bookmarkurl,"");
}
</script>

You can then place your bookmark link by adding an onClick function on your anchor tag like this:

<a href="javascript:addBookmark();">Bookmark this page!</a>

Here's a sample code:
Bookmark this page!

Please note that this code is browser dependent.

TrackBack

TrackBack URL for this entry:
http://www.tildemark.com/cgi-bin/mt/mt-tb.cgi/61

About

This page contains a single entry from the blog posted on February 12, 2007 6:28 AM .

The previous post in this blog was Enable curl with XAMPP on Windows XP .

The next post in this blog is X-Men Legends 2: Rise of Apocalypse .

Many more can be found on the main index page or by looking through the archives .

Creative Commons License
This weblog is licensed under a Creative Commons License .
Powered by
Movable Type 3.33