I have this code in index.html file:
$(function(){
$('a#link').live('click', function(e){
$("div#element").load("file.html");
});
});
In the file.html I have this code at the top
<script src="file.js" type="javascript"></script>
When I click on the link, the file loads fine, however the (according to firebug) the JavaScript file doesn’t load. Does anyone know why? I tried put the script tags in the index.html file aswell, but it doesn’t work like that.
Try loading the page scripts after the page is loaded in your div as follow:
A simpler way to fix this, as Pointy stated, is either to fix the
typeattribute or omit it.