IFrame forces javascript to not execute

Does anyone know why this code is not working. This means that the warning does not start.

<iframe/> <script type="text/javascript">alert('hello');</script> 

While this warning code BEFORE IFREMEUS works flawlessly. This means the alert is running.

 <script type="text/javascript">alert('hello');</script> <iframe/> 

It seems that the javascript placed after the iframe is not executing, I cannot find any logic.

+7
javascript html iframe
source share
1 answer

You need to close the <iframe> as follows:

 <iframe></iframe> <script type="text/javascript">alert('hello');</script> 
+10
source share

All Articles