[thelist] Javascript onclick doesn't fire?

Stephen Rider evolt_org at striderweb.com
Tue Aug 22 15:31:33 CDT 2006


Matt --

I suddenly feel a bit like the guy who rips out a bunch of <font>  
tags and replaces them with <span style="">.  I see what you're  
saying though -- I'm using a DOM method to insert a different method  
of inserting something in order to insert something, instead of just  
doing it directly.  I may have misread some of the intent of the book  
I'm working through (though admittedly I'm not done with it yet!), as  
from what I've read I was quite sure I was doing things the proper way.

Thank you.  The function you gave me worked like a champ.  I will  
have to investigate the other links further when I have more time;  
but for now, the pages are working again.

Cheers,
Steve

On Aug 22, 2006, at 2:27 PM, Matt Warden wrote:

> On 8/22/06, Stephen Rider <evolt_org at striderweb.com> wrote:
>> Does anyone have any idea what might be happening here?
>> <http://tinyurl.com/rtryv>
>
> It looks like you are using setAttribute(). First, this is sort of
> missing the point. Second, it won't work.
>
> It's missing the point, because you're trying to attach a JavaScript
> property, not a HTML attribute.
snip
> Second, it won't work, because IE doesn't like you using setAttribute
> for things where you have direct access to the JS property.
>
> You want to do something like this:
>
> arrPicLink[i].onclick = new Function(firstPart + (i+1) + thirdPart);




More information about the thelist mailing list