jQuery: is there a way to .LOAD() content that has script references in it?
I have 2 files. One called foo1.php and the other called foo2.php.
Contents of foo1.php:
<script type="text/javascript" src="yoxview/yoxview-init.js"></script>
<div class="yoxview">
<a href="files/Desert.jpg"><img src="files/Desert.jpg" alt="First" title="First image" /></a>
<a href="files/Hydrangeas.jpg"><img src="files/hydrangeas.jpg" alt="Second" title="Second image" /></a>
<a href="files/Jellyfish.jpg"><img src="files/Jellyfish.jpg" alt="Third" title="Third image" /></a>
</div>
Contents of foo2.php:
<script type="text/javascript" src="scripts/jquery-1.4.4.min.js"></script>
<script>
$(document).ready(function() {
$('.bar').load('foo1.php');
});
</script>
<div class="bar">this text will be replaced</div>
When I go to foo2.php I get a blank white page with a never ending loading favicon. I think this has something to do with loading the script:
<script type="text/javascript" src="yoxview/yoxview-init.js"></script>
in foo1.php since the contents of that page are passed through the .load() function. When I remove that script reference foo1.php loads just fine. I don't think this problem is specific to that particular script. If I try to load any page with a script reference the same result occurs (the blank page/loading favicon).
Is there a way to load content from another page that has script references?
EDIT
Here's the link to the problem script:
http://www.yoxigen.com/yoxview/yoxview/yoxview-init.开发者_运维知识库js
Try using this to intercept the document.write, it's worked for me in the past: https://github.com/iamnoah/writeCapture
精彩评论