Home » HTML » HTML_AJAX » Bug #6672
Automtically process javascript nodes when loaded through innerHTML
Details
| Request #6672 | Automtically process javascript nodes when loaded through innerHTML |
|---|---|
| Submitted | 2006-02-02 15:28 UTC |
| From | miguel dot manso at nfsi dot pt |
| Assigned | arpad |
| Status | Closed |
| Package | HTML_AJAX |
| PHP Version | 5.1.2 |
| OS | debian sarge 2.6.8-2-686-smp |
| Roadmaps | (Not assigned) |
Comments
[2006-02-02 15:28 UTC] miguel dot manso at nfsi dot pt
Description:
------------
I'm trying to get my webpage to process some javascript that is loaded through HTML_AJAX.
But it seems script nodes aren't automatically processed when adding them using innerHTML.
Is there any chance this could be implemented in a future release?
Thanx
[2006-02-05 00:36 UTC] jeichorn at php dot net
the issue is that if you have a document with a script block the script gets added to the document but it doesn't get run.
The first step is to create a util method that looks for all the script tags inside a given parent element and then evals all the ones that have a type of text/javascript.
Then its just a matter of adding a flag that turns on doing this automatically.
This would be for HTML_AJAX_Replace etc, and possible for the HTML_AJAX_Action stuff.
[2006-02-05 20:29 UTC] jeichorn at php dot net
HTML_AJAX action already provides a way to do it at the time of writing and its easy to tell what hasn't been run.
Any newly added script blocks haven't been run. And the whole point is too make what is happening transparent.