Edit report at http://pear.php.net/bugs/bug.php?id=18801&edit=1
ID: 18801
Updated by: daniel.oconnor@gmail.com
Reported By: piviul at riminilug dot it
Summary: HTML_AJAX.setInnerHTML have problems in firefox 5 or
greater
Status: Open
Type: Bug
Package: HTML_AJAX
Operating System: ANY
Package Version: 0.5.6
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
Thanks for the report Paolo; but pearweb seems to have eaten your test
case. Can Ii
get you to pastebin something?
Previous Comments:
------------------------------------------------------------------------
[2011-09-07 11:36:50] piviul
Description:
------------
In Firefox 5 or above when you append or replace a dom element
containing scripts these scripts are not reparsed (I have opened the bug
https://bugzilla.mozilla.org/show_bug.cgi?id=685098 but I don't know if
its a new feature). So if you use replace or append methods of
HTML_AJAX or you use directly the setInnerHTML method of HTML_AKAX_Util
if the replacing html code contain scripts these are not executed.
Test script:
---------------
<html><head>
<script type="text/javascript">
<?php include 'data/HTML_AJAX/js/util.js'; ?>
function init()
{
HTML_AJAX_Util.setInnerHTML(
"target",
"<script type='text/javascript'>"+
"alert('Hello world!');</"+
"script>",
"append"
);
}
</script>
</head><body onload="init();"">
<div id="target"></div>
</body></html>
Expected result:
----------------
I expect to see an alert saying "Hello World!"
Actual result:
--------------
nothing happens.
------------------------------------------------------------------------