日期:2014-05-16  浏览次数:20372 次

一个JS问题 ,我在DIV里面加上个javascrpit链接!
if (Ad_Status > 0) {

  ad = "<div style=width:200px; hight:100px;><script type=\"text/javascript'\" src=\"/tools/ad.aspx?pid=36 \" > </script></div>";
  }
麻烦看下那段代码错在那里!请指出!

------解决方案--------------------
多了个'? 想问下这段是想用来干嘛的?

ad = "<div style=width:200px; hight:100px;><script type=\"text/javascript'\" src=\"/tools/ad.aspx?pid=36 \" > </script></div>";
------解决方案--------------------
ad = "<div style=width:200px; hight:100px;><script type=\"text/javascript'\" src=\"/tools/ad.aspx?pid=36 \" > </script></div>";
}
hu

换成下面的
ad = "<div style=\"width:200px; hight:100px;\"><script type=\"text\/javascript\" src=\"\/tools\/ad.aspx?pid=36 \"><\/script><\/div>";
------解决方案--------------------
探讨

还是无效啊!!我这个是放在JS里面的!!

------解决方案--------------------
探讨

还是无效啊!!我这个是放在JS里面的!!

------解决方案--------------------
</script>分开写。。
------解决方案--------------------
src=\"\/tools\/ad.aspx?pid=36 \"
应该是路径的问题,请仔细检查一下!
------解决方案--------------------
全部代码能贴出来不
------解决方案--------------------
你这又是 DOM树,又是样式表,又是JS,看得我头晕脑胀。
------解决方案--------------------
最好不要等document都加载完毕之后 再来操作document.write,会把页面都重绘了.


要么就直接

HTML code

<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="gb2312" />
        <title></title>        
    </head>
    <body>
        <div id="tmp">
            <script src="http://www.top1.cn/tools/ad.aspx?pid=48"></script>
        </div>
    </body>
</html>