100分求解response.write“html”问题test1.asp
<script language="javascript">
$(document).ready(function(){ 
         $.get("test.asp",function(data){ 
   $('#td1').html(data);
   });   
       });
});
</script><td id="td1"><table width="<% if rs("a")>=rs("b") then%>100
<%else%><%=formatnumber(rs("a")/rs("b"))*100%>
<%end if%>%" > //根据数据的值更改 table的长度!
</table>
</td>test.asp
<%
response.Write("这里怎么写啊,我怎么写也没写对~~,我要输出完整的这个table,里边的东西都得保留,怎么写啊?")
%>

解决方案 »

  1.   

    将整个table放在你的输出里不行吗?  没接触过asp  不太熟悉它的输出
      

  2.   

    可以试试下边的方法:
    如果table是自己拼出来的,把所有html拼成的串放这里输出。
    如果table是服务器控件,把它Render到HtmlTextWriter,然后输出这个串。
      

  3.   


    还是不会~~帮忙给写写吧。就这一句就好<%
    string str
    str="这里又不会写"
    response.write("str")
    %>
      

  4.   

    来大哥大姐帮忙写一下啊!就这一小句!用response.write 输出!<table width="<% if rs("a")>=rs("b") then%>100
    <%else%><%=formatnumber(rs("a")/rs("b"))*100%>
    <%end if%>%" >
      

  5.   

    <%
    if rs("a")>=rs("b") then
    width=100
    else
    width=formatnumber(rs("a")/rs("b"))*100
    end ifResponse.Write("<table width="""&width&""">")%>
      

  6.   

    这样可以不页面
    <div id="table" runat="server"></div>后台
    String str = "<table>......</table>";
    this.table.innerHTML = str;
      

  7.   

    不都一个意思!关键是有HTML结构的响应是在js中组装还是在服务器端硬编码
      

  8.   

    不要用$.GET方法,用下面的
    var html = $.ajax
    ({
       url: "http://localhost:2028/test.asp",
       async: false
    }).responseText; 
    //alert(html); //你从服务器返回的是什么标签,这里就会原封不动的弹出
      

  9.   


    <table width=" <%= iif(rs("a")>=rs("b")?100, formatnumber(rs("a")/rs("b")))%>">