asp中关于ajax查询显示多个值的问题,懂的朋友进啊!!急,在线等,立刻结贴!

softffly 2008-07-19 01:31:52
要实现功能是在motif.asp中输入产品id则自动在一下文本框中显示名称,规格,形状(产品形状很多,所以是列表框全部列出)。现在的代码是motif.asp只能赋值到一个文本框中,其它的不能赋值,因为赋值是通过xmlhttp.responseText从xmlhttp.asp中传递过来的。怎么可以做到多个相应的值传递过来,就是说怎么传递xmlhttp.asp中的变量值呢??

页面motif.asp:代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script type="text/javascript">
<!--
var xmlhttp;
try{
xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
try{
xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp= new XMLHttpRequest();
}catch(e){}
}
}
function getName()
{
var id;
id = document.getElementById("myid").value;
xmlhttp.open("get","xmlhttp.asp?id="+id);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
document.getElementById("myname").value =unescape(xmlhttp.responseText);
}
}
xmlhttp.setRequestHeader("If-Modified-Since","0");
xmlhttp.send(null);
}
//-->
</script>
<title>实现即时查找数据 </title>
</head>

<body>

Name: <input type="text" id="myname" name="myname" />
size
<input name="size" type="text" id="size" />
shape
<select name="shape" id="shape">
</select>

</body>
</html>


xmlhttp.asp代码如下:

<%
Response.charset="GB2312"
on error resume next
set conn=server.CreateObject("adodb.connection")
strconn="Driver={SQL SERVER};Server=.;uid=sa;pwd=sa;database=memay;"
conn.open strconn
If Err Then
err.Clear
Set conn = Nothing
Response.Write Err.Description
Response.End
End If
set rs = server.CreateObject ("adodb.recordset")
id=Request.QueryString("id")
sql="select * from product where id="&id
rs.open sql,conn,1,1

if not rs.bof then
response.Write rs("product_id")
product_name=rs("product_name")
else
response.Write "暂无信息"
end if

%>



...全文
338 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
softffly 2008-07-19
  • 打赏
  • 举报
回复
好了,谢谢
sy_binbin 2008-07-19
  • 打赏
  • 举报
回复
[Quote=引用 9 楼 softffly 的回复:]
strArr数组有值,但strArr(1);赋值给不了啊??是不是引用错误
[/Quote]


把你res 里的数据贴出来
softffly 2008-07-19
  • 打赏
  • 举报
回复
strArr数组有值,但strArr(1);赋值给不了啊??是不是引用错误
softffly 2008-07-19
  • 打赏
  • 举报
回复
恩,我先试试,谢谢朋友了
sy_binbin 2008-07-19
  • 打赏
  • 举报
回复
首先你要先在xmlhttp.asp这个文件里把你要输出的字段都给查出来,然后链接成一个字符串
response.write rs("product_id")&","&rs("product_name")&","&规格&","&形状




然后
function getName(product)
{
var id;
id = document.getElementById("myid").value;
xmlhttp.open("get","xmlhttp.asp?id="+id);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState==4){
var res = unescape(xmlhttp.responseText);//接收服务器返回的数据
var strArr = new Array();
strArr=res.split(',');
document.getElementById("myname").value =strArr(1);
document.getElementById("size").value =strArr(2);


}
}
xmlhttp.setRequestHeader("If-Modified-Since","0");
xmlhttp.send(null);
}


你这样先试试
softffly 2008-07-19
  • 打赏
  • 举报
回复
朋友走了??????????谁能帮我?



地址给你,朋友看下http://cn.daoq.com/showmotif.asp
现在只能通过 document.getElementById("myname").value =unescape(xmlhttp.responseText);
返回到一个文本框中,其它的不能传值啊
softffly 2008-07-19
  • 打赏
  • 举报
回复
地址给你,朋友看下http://cn.daoq.com/showmotif.asp
现在只能通过 document.getElementById("myname").value =unescape(xmlhttp.responseText);
返回到一个文本框中,其它的不能传值啊
softffly 2008-07-19
  • 打赏
  • 举报
回复
是的
sy_binbin 2008-07-19
  • 打赏
  • 举报
回复
一个产品有多个形状????
softffly 2008-07-19
  • 打赏
  • 举报
回复
不是的,这样的我也不要问朋友了,是规格要放到规格的文本框中,形状 (多个)要放到下拉列表中.
有点难度的!!需要调用xmlhttp.asp中的变量。(定义产品id,产品名称,产品规格的变量,并且回传各个变量多对于的文本框或下拉框中)
sy_binbin 2008-07-19
  • 打赏
  • 举报
回复
xmlhttp.asp代码如下:

<%
Response.charset="GB2312"
on error resume next
set conn=server.CreateObject("adodb.connection")
strconn="Driver={SQL SERVER};Server=.;uid=sa;pwd=sa;database=memay;"
conn.open strconn
If Err Then
err.Clear
Set conn = Nothing
Response.Write Err.Description
Response.End
End If
set rs = server.CreateObject ("adodb.recordset")
id=Request.QueryString("id")
sql="select * from product where id="&id
rs.open sql,conn,1,1

if not rs.bof then
response.write rs("product_id")&","&rs("product_name")&","&规格&","&形状
else
response.Write "暂无信息"
end if

%>


然后在motif.asp里先
var res = xml.responseText;//接收服务器返回的数据

var strArr = new Array();
strArr=res.split(',');


myname=document.getElementById("myname");
myname.innerText=strArr[1];

size=document.getElementById("size");
size.innerText=strArr[2];


大概就这个意思吧
内容概要:本文详细介绍了名为MoSca的系统,该系统旨在从单目随意拍摄的视频重建和合成动态场景的新视角。MoSca通过4D Motion Scaffolds(运动支架)将视频数据转化为紧凑平滑编码的Motion Scaffold表示,并将场景几何和外观与变形场解耦,通过高斯融合行优化。系统还解决了相机焦距和姿态的问题,无需额外的姿态估计工具。文章不仅提供了系统的理论背景,还给出了基于PyTorch的简化实现代码,涵盖MotionScaffold、GaussianFusion、MoScaSystem等核心组件。此外,文深入探讨了ARAP变形模型、2D先验到3D的提升、动态高斯表示、相机参数估计等关键技术,并提出了完整的训练流程和性能优化技巧。 适用人群:具备一定计算机视觉和深度学习基础的研究人员和工程师,特别是对动态场景重建和新视角合成感兴趣的从业者。 使用场景及目标:①从单目视频重建动态场景的新视角;②研究和实现基于4D Motion Scaffolds的动态场景表示方法;③探索如何利用预训练视觉模型的先验知识提升3D重建质量;④开发高效的动态场景渲染和优化算法。 其他说明:本文提供了详细的代码实现,包括简化版和深入扩展的技术细节。阅读者可以通过代码实践加深对MoSca系统的理解,并根据具体应用场景调整和扩展各个模块。此外,文还强调了物理启发的正则化项和多模态先验融合的重要性,帮助实现更合理的变形和更高质量的渲染效果。

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧