I need load piece of content into my div, I need execute the script I have in remote div, for example I have
<div id="thisIsRemoteContent">
<script src="blabla.js"></script>
</div>
in the remote-content.html
Now I need load it with script to my page
$('.mydiv').load("remote-content.html #thisIsRemoteContent");
In jquery API documentation was written that if I load piece of contet, then the script will not be executed.
When calling .load() using a URL without a suffixed selector expression, the content is passed to .html() prior to scripts being removed. This executes the script blocks before they are discarded. If .load() is called with a selector expression appended to the URL, however, the scripts are stripped out prior to the DOM being updated, and thus are not executed.
However, how can I load it with script?