jQuery.load不与文件撰写执行的JavaScript不与、文件、jQuery、load

2023-09-10 16:46:50 作者:假装不在意 #

我想使用jQuery.Load加载广告调用,有一个文件撰写,而由于某种原因,它不能够,或在Firefox ATLEAST,重新加载与整个广告的页面。

I am trying to use jQuery.Load to load an ad call that has a document.write, and for some reason its not able to, or in firefox atleast, reloads the page with the entire ad.

这里是code的简化版本。

Here is the simplified version of the code.

DynamicLoad.html

DynamicLoad.html

<html>
<head>
<script src="http://www.prweekus.com/js/scripts.js?3729212881" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Load of Script</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
   google.load("jquery", "1.3.2");
</script>
<script type="text/javascript">
   $(document).ready(function(){
    $("#myButton").click(function() {
        $("#myDiv").load("source.html");
    });
   });
</script>
</head>
<body>
<button id="myButton">Click Me</button>
<div id="myDiv"></div>

<div id="slideAdUnit"></div>

</body>
</html>

Source.html

Source.html

<script language="javascript" type="text/javascript">
  document.write('<script language="javascript" type="text/javascript"><\/script>');
</script>
test

一旦你点击在FF按钮,浏览器只是等待的东西加载。有什么想法吗 ?

Once you click the button in FF the browser just waits for something to load. Any thoughts ?

最后,我将传递指向我们的广告服务器中的文件撰写一个src元素。

Eventually I would be passing a src element in the document.write which points to our ad server.

感谢您的帮助。

推荐答案

您无法使用文件撰写