我有以下jQuery完美运行,除了它覆盖第二列中的内容,而不是填写第三列中的单元格,是否有任何建议?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/PSCRM.asp" -->
<%
Dim rs_Search
Dim rs_Search_cmd
Dim rs_Search_numRows
Set rs_Search_cmd = Server.CreateObject ("ADODB.Command")
rs_Search_cmd.ActiveConnection = MM_PSCRM_STRING
rs_Search_cmd.CommandText = "SELECT * FROM DBA.PRODITEM WHERE PRODREF LIKE '84%' AND CREATED >= '2015-11-01'"
rs_Search_cmd.Prepared = true
Set rs_Search = rs_Search_cmd.Execute
rs_Search_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
rs_Search_numRows = rs_Search_numRows + Repeat1__numRows
%>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<button>Get External Content</button>
<table width="50%" border="0" cellspacing="2" cellpadding="2">
<%
While ((Repeat1__numRows <> 0) AND (NOT rs_Search.EOF))
%>
<tr>
<td class="pn"><%=(rs_Search.Fields.Item("prodref").Value)%></td>
<td>Some Other text goes here</td>
<td bgcolor="#FF0000" class="result"> </td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs_Search.MoveNext()
Wend
%>
</table>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$( "button" ).click(function() {
var pn = $(".pn").text();
$( "td.pn" ).each(function() {
$(this).next().load("data.asp?prodref="+($(this).text()))
});
});
</script>
</body>
</html>
<%
rs_Search.Close()
Set rs_Search = Nothing
%>
任何帮助都会很棒。正如我所说,我对我的代码感到满意,我只需要用class="result"
答案 0 :(得分:1)
$(this).next().next().load("data.asp?prodref="+($(this).text()))
无论如何你的解决方案都很糟糕,因为如果你有100行,它将向服务器发出100个请求