Home‎ > ‎My Notebook‎ > ‎

JavaScript Tips

I jot down JS tips as I come across them in my work as a web developer - Rob Chandler.

Style={cursor: hand;} - works in IE but not in FireFox

Style cursor: hand; wont work in FireFox. Hand is an IE setting. Instead use  cursor: pointer;
Don't think it works in IE5 and back. Try putting both in your CSS...


Click to Activate warning in IE6/IE7

In April 2006, MS made a change to how Internet Explorer handled embedded controls used on some webpages.
Some sites required users to “click to activate” before they could interact with the control. Microsoft has now licensed
the technologies from Eolas and from April 2008 plan to remove the “click to activate” behavior from Internet Explorer!

To get the fix (after April 2008) enable Automatic Update or check Windows Update.
You can download the fix - http://support.microsoft.com/kb/945007

FireFox Vs IE - Controlling DIV size

In Firefox 3 I found that style,margin and style.border would increase the overall size of a DIV. While in IE7 the size would generally remain the same.

This makes this very difficult in some situations where you want thing aligned pixel perfect in both browsers.

Stopping Bookmarks behaving like Anchor Links

One day I found all my bookmarks on my site picking up my CSS link hover effects.

Makes sense: <a name="bookmark">xxx</a> is very similar to <a href="linkURL">xx</a>.
Here's how to stop this: http://www.timrivera.com/tests/hover.html