I was working through using XML to transfer an HTML string to a page (TABLE) to service a JavaScript treeview. It uses DOM and innerHTML to assign the string inside SPAN tags. It works.
The string includes (A)nchor tags with onclick events. In order to build a parsable XML, things like WIDTH assignements need to have their numerical values inside quotes
(WIDTH="0")
. And the onclick method requires quotes around the JavaScript function pointer to be effective
onclick="myJavaFunction(this)"
With FireFox innherHTML shows:
(A id="ATAG" onclick="myfunction()")(/A)
With IE:
(A id="ATAG" onclick=myfunction())(/A)
Whats amazing about this is that a server issued XML script filled with HTML tags actually fires the functions predefined in the client "pages".
With Firefox, reading the innerHTML of a document (alert(document.spanobj.innerHTML);) renders the contained HTML and includes the "quote" marks.
With IE the quotes are stripped from both the dimension tags and method tags. I am using IE 6.1 for this project. Is that still the case with IE. Also, IE does not allow addressing a TAG unless it is referenced by a "getElementID("spanobj").
Is there a flag feature that will allow IE's implementation of innerHTML to retain the quote marks?
Imagination is more important than knowledge