Clicking a link results in blank page with “true” in IE7

If clicking on a link containing a javascript results in a white page contining nothing but the word “true” or “false”, check the link to see if it is written in the form:

<a href="javascript:yourfunction();">link text</a>

If so, try rewriting it in the form:

<a href="#" onclick="yourfunction();">link text</a>

Certain browsers, particularly IE, will show the return value of the function rather than executing it under certain conditions. I’ve found this issue when using swfObject to write a Captivate swf to the page like this:

<a href="javascript:so.write("CaptivateContent")">Click to show movie</a>

results in blank page containing “true” in IE7. Using the onclick statement fixes the problem.