Main

Javascript Archives

November 15, 2006

Making the entire div clickable

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='/';" style="cursor: pointer;">
</div>

February 12, 2007

Adding Bookmark This link to your website using 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.

About Javascript

This page contains an archive of all entries posted to Tildemark blogs in the Javascript category. They are listed from oldest to newest.

CSS is the previous category.

Mod_rewrite is the next category.

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