Closed
Description
the pjax response content:
<script src="/js/test.js">
</script>
<script>
alert(Test.test());
</script>
the test.js:
var Test = {
test: function(){
return "Testing!";
}
}
At first, Pjax will parse html content and run the inline script with 'eval', but the test.js hasn't been load because it is removed from the content and will be added to head later. The console prints 'Test' is undefined, and so, test.js will be never added to head, that means the object Test will always be undefined.
Script tags with src attribute are not all javascript libs only with object defined in it, they could contain some lines which is executable, and should run when loaded every time for the pjax response content.
Moving all scripts with src attribute to head is a kind of idiot behavior.
Metadata
Metadata
Assignees
Labels
No labels