Geeks With Blogs

The Life and Times of a Dev Yes, we're really that weird

I hate non-strongly typed languages, but when you're doing client stuff, you're stuck with Javascript.

So basically, I've created an XSL stylesheet and pass in some xml so that the page can dynamically be updated.  Only problem is XSL doesn't like Javascript.  So after replacing all of the verboden entities (i.e. < with &lt; etc), I'm able to get the java script to work.  Only problem, I'm matching on the id of the control, and if it's the one I want, I set the controls style property like so:'inline';

if it's not the one I want, I set it to:'none';

This works great until I add content to the page that has embedded html.  I'm iterating through all of the child controls of a single parent control and then hiding or revealing them as appropriate.  All I had to do was to restrict what controls I set the style on to only span controls.

Hmm--just thought of a bug, though.  All span controls will be hidden unless they have the right id, and since ids are unique, I can't use span controls in the html.  I guess I'm going to have to set them all to a special class and check both tagname AND their class.  Fun Fun!

Posted on Friday, December 16, 2005 12:22 PM Work | Back to top

Comments on this post: Debugging Javascript

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Robert May | Powered by: