ajax 处理返回值的问题

Kangkang1314 2008-12-29 03:31:20
返回值:
HTTP/1.1 200 OK
Connection: close
Date: Mon, 29 Dec 2008 06:38:41 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/5.1.4
Content-type: text/html

<!--Array
(
[txtDepDate] => 2008-12-30
[txtDepPort] => SHA
[txtArrPort] => DLC
[txtAirways] => ALL
[search_number] => 1
)
--> <br />
<b>Notice </b>: Undefined index: txtBackDate in <b>E:\web\ibe\ibe_service\index.php </b> on line <b>68 </b> <br />
<br />
<b>Notice </b>: Undefined index: radio in <b>E:\web\ibe\ibe_service\index.php </b> on line <b>71 </b> <br />
<html>
<head>
<body>
<form ...>
<input type="hidden" name="tt[]" value="xxxxxxxxxxxx" />
<input type="hidden" name="tt[]" value="xxxxxxxxttt" />
<input type="hidden" name="tt[]" value="xxxxxxaaaaa" />
<input type="hidden" name="tt[]" value="xxxxxxxxyyyy" />
请问,如何得到这个返回值中的 tt 表单数组 的值

...全文
78 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
LIHY70 2008-12-29
  • 打赏
  • 举报
回复

var re = new RegExp("name=\"tt(.*) value=\"(.*)\"","g");


var str = xmlHttp.responseText;
var arr= str.match(re);

for(var i=0;i< arr.length;i++){
alert(arr[i].replace(re,"$2"));
}
chaorenwopashei 2008-12-29
  • 打赏
  • 举报
回复
用数组索引么,for循环就可以了,
阿云ivan 2008-12-29
  • 打赏
  • 举报
回复
看不懂

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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