Lets start all over,
I was using AJAX to retrieve a part of the contents of a web page. Cool, simple, it downloaded without a pain, then I innerHTMLed it to a span tag. Worked fine, successful, clapped my hands etc.etc.
Clicked on the button which had seemed to appear out of nowhere.
And then, it all fell apart.
The feared exclamatory symbol appeared on the status bar.... And for the newbies, thats an indication of a JavaScript error in IE.
Of course, as usual i was all curses at my IE window......Anyway to make a long story short (i AM quite sleepy u know). the scripts which i seemed to be innerHTMLing to the span tag are not executed. And what i mean is anything between the script tags which have been innerHTMLed to that span tag are not executed.
Of course i can see a ray of hope in the distance. I mean the distance till tomorrow morning.
And just for kicks, check out a hi-fundoo flash file titled EPIC 2004 .
And for all the Indians out there, Check out Param Padma. 1 TeraFlop/second.
For the non-indians of course there is Earth Simulator, Japan's 40-Teraflop/second.
Comments
If you haven't solved it yet, the problem might be your markup's doctype, if you are serving as XHTML. You can't innerHTML text into a XHTML document. In fact, the XHTML DOM doesn't have an innerHTML function at all!
Instead, you should use the DOM methods (like createElement) to create the markup you need.
It's logical, if you think about it. If you innerHTML text into a XHTML document, you might break the XML structure of the document. Using the DOM functions, you can never break the XML structure.
Of course, all of this is not a problem if you are using HTML. HTML is not valid XML anyway!
By the way, if you are using XHTML, don't use IE! IE doesn't even support XHTML. It thinks it is HTML and proceeds to render it like any HTML page. Not usually a problem, but you don't really have any of the benefits of XHTML that way, and you would never know (unless you validate) if your markup is ill-formed.
Actually, just stop using IE anyway. Get Firefox! And one you have the JS-related extensions installed, you'll see how easy it is to develop client-side code. :)
1. Since IE renders XHTML as HTML, innerHTML is supported with any document type anyway.
2. Most recent versions of Firefox have support for innerHTML with XHTML documents, provided the string you are adding is a valid XML snippet.