PDA

View Full Version : any really (or kinda) good debuggers?



kosi
06-22-2006, 08:21 AM
Can somebody tell me what's wrong with this code and why ie keeps telling me there's an error in the syntax? Thanks, I appreciate it.


<a href="javascript:void();" onClick="document.pic.src='q_armsout.jpg';"><img src="c_armsout.jpg"/></a>

. . .


<img src="q_bnw3.jpg" name="pic" style="border: #bb5500 outset 10px;" />
@)~}~~~

mahi
06-22-2006, 11:07 AM
Hi,

The error is due to using the void keyword in 'javascript:void()'.
Replace the standard keyword in the function name and then execute it. It works fine for me.

-P.Maheswari
Syncfusion Software
(www.syncfusion.com)

Twey
06-22-2006, 01:07 PM
Rubbish. "void" is not a keyword in Javascript; it's a simple function that looks like this:
function void(a) {
}Used for nullifying return values where they could be unhelpful.

Try this:
<a href="javascript:void(0);" onclick="document.images['pic'].src='q_armsout.jpg';"><img src="c_armsout.jpg" /></a>

kosi
06-22-2006, 06:24 PM
it works! thanks.

Twey
06-22-2006, 06:48 PM
Actually, I'm mistaken above: it would appear to be an operator.