Response.Write "document.getElementById('detail').innerHTML ="&body&";" 

解决方案 »

  1.   

    js报错?
    把报错的html源文件贴出来
      

  2.   

    Response.Write "document.getElementById('detail').innerHTML ="&body&";"
    向前台输出时  注意"" 和''要交替应用,如果外层用""那么内层就要用'',反之也一样;
    如 obj.innerHTML="<div id='div1' name='div11'></div>";
      

  3.   


    Whois Server Version 2.0<br>
    <br>
    Domain names in the .com and .net domains can now be registered<br>
    with many different competing registrars. Go to http://www.internic.net<br>
    for detailed information.<br>
    <br>
    红色的是body得到的值,我发现它只能显示其中的“Whois Server Version 2.0<br>”这一行,读到下一行就出错,我调用方式是
    index.asp页
    <div id="detail"></div>
    <script language="javascript" type="text/javascript" src="loading.asp?Domain=163.com"></script>
    loading.asp页
    Response.Write "document.getElementById('detail').innerHTML ='"&body&"';"
    body中的单引号和双引号都被替换掉了。请帮我看看,调试了好久了,搞不明白。
      

  4.   

    补充一下,loading.asp可以全部读取body值,就是只能传递"Whois Server Version 2.0 <br>”这一行到detail,这一行以下内容不能传递。
      

  5.   

    要放在页面最后,否则,'detail'标记可能还没有存在啊
      

  6.   

    Response.Write "<script>document.getElementById('detail').innerHTML ='"&body&"';</script>" 
      

  7.   

    都放在最后的,还是不能传到index.asp
      

  8.   

    <script language="javascript" type="text/javascript" src="loading.asp?Domain=163.com"> </script> 
    你是这样的调用形式没注意提示的什么错误
      

  9.   

    body值:
    -------------
    Whois Server Version 2.0 <br> 
    <br> 
    Domain names in the .com and .net domains can now be registered <br> 
    with many different competing registrars. Go to http://www.internic.net <br> 
    for detailed information. <br> 
    <br> 
    -------------
    提示“未结束的字符串常量”
    问题可能出现最后:Response.Write " <script>document.getElementById('detail').innerHTML ='"&body&"'; </script>"
    可是当只取第一行时能正常显示在index.asp的detail中,取全部就出现提示“未结束的字符串常量”,真是郁闷,真的想放弃这种效果了。这个程序就是查询whois信息的,效果和http://tool.chinaz.com/Whois/Default.aspx一样.
      

  10.   

    body = Replace(body,"'","\'")
    body = Replace(body,vbCrLf,"")Response.Write "  <script>document.getElementById('detail').innerHTML ='"&body&"';  </script>" 因为你的里面有换行啊。
      

  11.   

    哈哈,也是受了你的启发,但我知道问题所在,我公司的网站也正要这样出理
    你看看 http://www.qisoe.com 随便一个关键字,然后看右上有提示搜索到几条的,就是这样做的
    你是少了单引号,所以不行,哈哈,多多注意一下就行了