From: Brehm, R. P <rob...@of...> - 2004-11-30 16:37:52
|
Marc, Thanks for the hint! I did some further research on getElementsByTagName, and I discovered that it returns an array which in strict Javascript requires the [] notation. The following change worked: ssnTableRows[i].getElementsByTagName("td").item(1).style.backgroundColor="white"; to var tdElements = ssnTableRows[i].getElementsByTagName("td"); tdElements[1].style.backgroundColor = "white"; I guess I was using JScript notation and the Rhino engine correctly did not process. Regards, Bob Brehm -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Marc Guillemot Sent: Wednesday, November 24, 2004 6:28 AM To: htm...@li... Subject: Re: [Htmlunit-user] JavaScript question sorry, I've read this to fast and I was thinking about double access syntas with () and []. Marc.. Mike Bowler wrote: > Marc Guillemot wrote: > >> this can probably be fixed making the object returned by >> "getElementsByTagName("td")" both a "normal" object and object >> implementing interface org.mozilla.javascript.Function as I've done it >> for document.all. > > > > I'd read the question as "can I generically tell HtmlUnit to not throw > exceptions when it hits javascript it can't handle" and I still don't > know how that would be done. Perhaps if we caught the exceptions in > executeJavaScriptIfPossible() and then ignored them if the user had > specified "suppress javascript exceptions" or something similar. > > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |