My post should have had
<a href="javascript:void(0);" onClick="return false;">
The javascript: protocol evaluates the expression after the colon
), if there is one, and loads a page containing the string value
of the expression, unless it is undefined. If the expression evaluates to undefined (by calling a void function, for example
javascript:void(0)), no new page loads.
By making it an explicit void you save javascript the trouble of determining it is undefined (and the possible errors of the space
as per the users post)
- the onclick "kills" the click event
| How's <a href="javascript:void(0)" better than <a href="javascript:;" ? I've
| always used the second out of habit but never thought there was anything to
| chose between the 2.
|
| --
| Cheers,
| Jon
| Microsoft MVP
|
| | > Better still for an empty link use javascript:void(0)
| > <a href="javascript:void(0) onClick="return false;">
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| >
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | > | You have a space between the word javascript and the semi-colon. Remove
| > the
| > | space so it reads juts javascript;
| > |
| > | --
| > | David Berry - MCP
| > | Microsoft MVP - FrontPage
| > | FrontPage Support:
http://www.net-sites.com/sitebuilder/
| > | -----------------------------------
| > | To assist you in getting the best answers for FrontPage support see:
| > |
http://www.net-sites.com/sitebuilder/newsgroups.asp
| > | -----------------------------------
| > | | > | >I am trying to add behaviours to a transparent image to close a drop
| > | > down menu.
| > | >
| > | > To be able to use a mouseover behaviour on the transparent image, I
| > | > believe I have to add a hyperlink to the image. I read in a tutorial
| > | > that using the hyperlink :
| > | >
| > | > "javascript: ;" -- without the quotes
| > | >
| > | > would allow me to have a link that wouldn't do anything. But when i
| > do
| > | > this it give me a link that -- if pressed -- causes the page to become
| > | > an error with the web address of "javascript:%20;"
| > | > Any advice? Much appreciated and thanks
| > | >
| > | > (e-mail address removed)
| > | >
| > |
| > |
| >
| >
|
|