JQuery .html() method and external scripts

Posted by Marco on Stack Overflow See other posts from Stack Overflow or by Marco
Published on 2010-03-21T11:15:18Z Indexed on 2010/03/21 11:21 UTC
Read the original article Hit count: 357

Filed under:
|
|
|

Hi,

i'm loading, using the JQuery ajax() method, an external page with both html and javascript code:

<script type="text/javascript" src="myfile.js"></script>
<p>This is some HTML</p>
<script type="text/javascript">
     alert("This is inline JS");
</script>

and setting the results into a div element, using the html() method.

While the html() method properly evaluates the inline JS code, it doesn't download and evaluate the external JS file "myfile.js".

Any tip for this issue?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript