Recently in Javascript Category

2007 Feb 12

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.

2006 Nov 15

We could make an entire div tag clickable by redirecting the click to a page and by changing the cursor sytle to a pointer. This is good if you want your logo or your banner to be clickable, specially if the logo is embedded together with the banner. Making the entire banner clickable would be very beneficial to your site.

<div onclick="location.href='http://www.tildemark.com/';" style="cursor: pointer;">
</div>

About this Archive

This page is a archive of recent entries in the Javascript category.

CSS is the previous category.

Mod_rewrite is the next category.

Find recent content on the main index or look in the archives to find all content.