J
Joey33
Hello,
Maybe some of you have got acquainted with WYZZ wysiwyg editor. I'm
trying to add one innocent thing and I beleive the problem is about IE
and DOM in general that's why I'm writng to all of you generous and
wise people out there hoping for some clue...
Here's the problem:
In the main site there is one iframe where the user edits text, then
changes selections to bold, changes colours etc. Typical wysiwyg
editor.
There's also the option of inserting images. And here's my nightmare.
I edited the code a d d i n g onClick event to this newly inserted
image. So the code should finally look like this:
<img src="..." onClick="parent.somefunction()" alt="...">
everything works fine in FF but of course IE imposes some other
philosophy wrapping the attribute of onClick event within a new
function and generates:
<img src="..." onClick="function Anonymous() {parent.somefunction()}"
alt="">
which doesn't work of course.
For clarity, this code is generated by a function in WYZZ which makes
code from the iframe XHTML compliant. It goes through all childNodes
of body (in the dynamically generated page) and makes their nodeNames
lower case, adds / before closing tags etc. Basically it builds a new
body node but XHTML.
When I switched it off for a while, the onClick event is NOT changed
BUT quotes in all other attributes are gone...
so when not making xhtml compliant I end up with:
<img src=source alt=alttext onClick=parent.somefunction()>
When extracting iframe.body.innerHTML all the attribute values are
suddenly with no quotes...
This is some nightmare... It's my fourth day of struggling with the
weird ie.
Hoping for some clue,
Regards,
Konrad
Maybe some of you have got acquainted with WYZZ wysiwyg editor. I'm
trying to add one innocent thing and I beleive the problem is about IE
and DOM in general that's why I'm writng to all of you generous and
wise people out there hoping for some clue...
Here's the problem:
In the main site there is one iframe where the user edits text, then
changes selections to bold, changes colours etc. Typical wysiwyg
editor.
There's also the option of inserting images. And here's my nightmare.
I edited the code a d d i n g onClick event to this newly inserted
image. So the code should finally look like this:
<img src="..." onClick="parent.somefunction()" alt="...">
everything works fine in FF but of course IE imposes some other
philosophy wrapping the attribute of onClick event within a new
function and generates:
<img src="..." onClick="function Anonymous() {parent.somefunction()}"
alt="">
which doesn't work of course.
For clarity, this code is generated by a function in WYZZ which makes
code from the iframe XHTML compliant. It goes through all childNodes
of body (in the dynamically generated page) and makes their nodeNames
lower case, adds / before closing tags etc. Basically it builds a new
body node but XHTML.
When I switched it off for a while, the onClick event is NOT changed
BUT quotes in all other attributes are gone...
so when not making xhtml compliant I end up with:
<img src=source alt=alttext onClick=parent.somefunction()>
When extracting iframe.body.innerHTML all the attribute values are
suddenly with no quotes...
This is some nightmare... It's my fourth day of struggling with the
weird ie.
Hoping for some clue,
Regards,
Konrad