Hello everyone... I have started lately using MochiKit and I need to
load HTML from server and display within a page...
I load the html and place it within a div using div.innerHTML.
This works fine except for JavaScript (<script>...</script>)
definitions... For example, if I load the following HTML:
<script type="text/javascript">
function doit(){
alert('doing it')
}
</script>
<a href="javascript:doit()">click here</a>
and place it within a div I get an error when I click the link "doit
not found" it says...
I tried the following fix, which worked for FireFox but not IE6:
for (var i =0; i < div.childNodes.length;i++){
var node = div.childNodes[i]
if (node.nodeName.toLowerCase() == "script"){
eval(node.innerHTML)
}
}
The problem is that IE does not place the "script" tag under the "div"
all together... I am not sure if someone has resolved this already.
The "evalHTML" function does NOT work and suffers from the same
problem...
Any help here would be greatly appreciated,
/Eiad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---