我先通过readt.asp读取数据
然后以Response.Write("document.write("""&content&""")")生成数据,最后在站外以这种方式<script type="text/javascript" src="http://localhost/readt.asp?categoryid=496"></script>读取数据。。除了纯文件可以正常读取外,带有一点点HTML标记的内容都读不出来测试时在FF下提示:unterminated string literal高求路过帮忙指点一二。。

解决方案 »

  1.   

    这个很正常,使用src加载的外部js文件,不允许出现任何非js代码以外的标记。
    这个情况在任何浏览器中都会提示错误。
      

  2.   

    Response.Write("document.write("""&content&""")")
    这个有必要吗,直接这样就行了:
    Response.Write(content)你返回的时候,用这样的格式看看:
    Response.Write(“var theforever_csdn=”+content)然后:
    <script type="text/javascript" src="http://localhost/readt.asp?categoryid=496"></script>
    <script type="text/javascript">
    alert(theforever_csdn); //这里就可以显示返回内容了
    </script>