Closed Bug 320226 Opened 20 years ago Closed 20 years ago

dynamic loading of script

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 147581

People

(Reporter: zapov, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 I'm wondering why Firefox (but IE and Opera to) doesn't load both of this javascipt code dynamically even if it creates the same DOM objects. Here is a short example <html> <body> <div id='wnd1'> <script type='text/javascript'> var s1="<sc"+"ript type='text/javascript'>alert('non default load');</s"+"cript>"; var s2="alert('non default load')"; </script> <input type='button' value='not working' onclick="document.getElementById('wnd2').innerHTML=s1;" /> <input type='button' value='working' onclick="var ob=document.getElementById('wnd2').appendChild(document.createElement('script'));ob.type='text/javascript';ob.innerHTML=s2;" /> </div> <div id='wnd2'></div> </body> </html> Reproducible: Always Steps to Reproduce: 1. run html example entered in details Actual Results: alert message only from one input button Expected Results: alert message from both input buttons IE and Opera work just like Firefox, so this might not be a bug but some javascript specification. But, still I am having trouble understanding why
This is intentional, see bug 147581. Look at bug 116834 for one example of the problems executing <script> tags in innerHTML would cause. *** This bug has been marked as a duplicate of 147581 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.