<script src="http://un.so.gougou.com/js/SearchView.js" charset="gbk"></script>
<script> xprint(13880,205,300,300); </script>以上代码是我网站做的狗狗的广告.
现在我把上面的内容放到一个js文件中,代码如下:adGougou.js
document.write("<script src='http://un.so.gougou.com/js/SearchView.js' charset='gbk'></script>");
document.write("<script> xprint(13880,205,300,300); </script>");然后再把adGougou.js包含到文件中,包含代码如下:
<script src="/adGougou.js"></script>这时却不再显示广告内容.而且还出错.
不知道是不是这样子不行.如果不行的话,哪位高手教我如果写这代码?先谢了.要求:要把最上面两行放到js文件中.

解决方案 »

  1.   


    document.write(" <script   src='http://un.so.gougou.com/js/SearchView.js'   charset='gbk'> <\/script> "); 
    document.write(" <script>   xprint(13880,205,300,300);   <\/script> "); 
      

  2.   

    或者<script>   
      document.write("<scri"   +   "pt  src="..........."></  s"   +   "cript>");   
      </script>   
      

  3.   

    <script>
    document.write("<script"+" type='text/javascript' src='x.js'></sc"+"ript>");
    </script>
      

  4.   

    二楼的朋友写得最清楚了.可是还是出错.并不显示广告内容.三楼的朋友的没有出错了,但也没显示广告内容.我现在站上放的内容是三楼朋友的,效果:http://www.book52.com/article/sort020/sort0173/sort0194/info-20571.html正常显示的页面(代码是直接放文件中,而不是放在js文件中):http://www.book52.com/article/sort02/sort0147/info-7403.html哪位知道要如果修改,请帮一把.急.
      

  5.   

    please tryadGougou.js 
    document.write("<script" +" src='http://un.so.gougou.com/js/SearchView.js' charset='gbk'></"+"script>"); 
    document.write("<script"+">xprint(13880,205,300,300);</"+"script>"); 
      

  6.   

    楼上的朋友,我把你的代码放上去了.但是还是不行.效果在页面http://www.book52.com/article/sort020/sort0173/sort0194/info-20644.html能看到.相应的js文件为http://www.book52.com/inc/AdArticleContent.js,内容就是楼上朋友的内容.可以下载看.哪位高手请帮一把.谢.
      

  7.   

    <script   src="/adGougou.js"> </script> 
    /adGougou.js有问题 去掉/
      

  8.   

    楼上的朋友不对,我把我调用js文件的代码贴出:<script language="JavaScript" type="javascript" src="/inc/AdArticleContent.js"></script>但是不能去掉/
    /表示根目录,如果去掉就找不到文件了.
      

  9.   

    哪个朋友能不能花点时间帮我仔细想看下?我能肯定的是.一定是AdArticleContent.js这个文件出错了.只是不知道代码要如何写.AdArticleContent.js文件的内容:
    document.write("<script" +" src='http://un.so.gougou.com/js/SearchView.js' charset='gbk'></"+"script>"); 
    document.write("<script"+">xprint(13880,205,300,300);</"+"script>"); 我又查看地gougou的js文件SearchView.js,发现SearchView.js这个文件也包含了其它的js文件.
    所以我在想,是不是跟包含的层数有关系?是不是js文件一定只能包含多少层?急,还请哪位好心人细心帮下忙.
      

  10.   

    <script>里面是不能再加<script>了的,只能另想他法
      

  11.   

    你在一个.JS里文件里又来<script></script>显然是有问题的
      

  12.   

    myScript=document.createElement('script');
    myScript.src='http://un.so.gougou.com/js/SearchView.js';
    document.body.appendChild(myScript);
    xprint(13880,205,300,300);