FAQ
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.

------------------------------------------------------------------------

Search Discussions

  • Daniel Oconnor at Sep 18, 2011 at 7:30 am
    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
    +Status: Feedback
    Type: Bug
    Package: HTML_AJAX
    Operating System: ANY
    Package Version: 0.5.6
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Feedback



    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-18 09:31:08] doconnor

    Thanks for the report Paolo; but pearweb seems to have eaten your test
    case. Can Ii
    get you to pastebin something?

    ------------------------------------------------------------------------

    [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.

    ------------------------------------------------------------------------
  • Piviul at Sep 19, 2011 at 8:33 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18801&edit=1

    ID: 18801
    Updated by: piviul@riminilug.it
    Reported By: piviul at riminilug dot it
    Summary: HTML_AJAX.setInnerHTML have problems in firefox 5 or
    greater
    Status: Feedback
    Type: Bug
    Package: HTML_AJAX
    Operating System: ANY
    Package Version: 0.5.6
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    Ok; this is the very little code I wrote: http://pastebin.com/uJfcxmB4

    It's a big problem because firefox has marked the bug as I won't fix.
    The solution I have adopted is to set to false the variable good_browser
    in HTML_AJAX_Util::setInnerHtml

    Have a great day

    Piviul


    Previous Comments:
    ------------------------------------------------------------------------

    [2011-09-18 09:31:24] doconnor

    -Status: Open
    +Status: Feedback


    ------------------------------------------------------------------------

    [2011-09-18 09:31:08] doconnor

    Thanks for the report Paolo; but pearweb seems to have eaten your test
    case. Can Ii
    get you to pastebin something?

    ------------------------------------------------------------------------

    [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.

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 18, '11 at 7:30a
activeSep 19, '11 at 8:33a
posts3
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 2 posts Piviul: 1 post

People

Translate

site design / logo © 2022 Grokbase