...

View Full Version : Adding onclick via DOM (IE)



zro@rtv
05-13-2007, 02:48 AM
I know this is greatly discussed, and perhaps i am simply overlooking the answer in post elsewhere. I apologize if this is the case.

here is a page (http://ec3kids.org/staff) where this javascript (http://ec3kids.org/js/displayCitations.js) is supposed to be taking effect.

Everything is fine in FF, as per usual.
In IE, though I get no effect, and the error states:


Line:9
Char:5
Error:Object doesn't support this property or method
Code:0
URL:http://ec3kids.org/staff

I find this confusing as it does not even seem to point to the JS, and even if I assume it means that JS file linked above, that line/column number seems irrelevant, not to mention, I thought I had enough error checking in place that errors shouldn't occur.

On an even stranger note, when I try any of this locally, half of the functionality works. Namely the "additional link" is appended, and the "style:cursor;" attribute is applied. None of that even works when accessed on the server.

I have tried using "setAttribute()", and "element.onclick=" with both an anonymous function and also simply the window.location as the value.

wtf am i supposed to be doing here?
Thanks for any time and effort put into this!

rwedge
05-13-2007, 08:56 AM
IE does not support hasAttribute

This line is giving the error:
if (!quotes[i].hasAttribute("cite")) continue;



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum