【发布时间】:2014-12-09 05:11:06
【问题描述】:
我正在尝试使用 XMLHTTP GET 从 URL 检索输出:
直接点击url时浏览器的输出如下:
{
"Titles": {
"resultCount": 37680,
"moreResources": true
}
}
我正在使用的 test.asp 上的 ASP 代码是:
<%@language=JScript%>
<%
var objSrvHTTP;
objSrvHTTP = Server.CreateObject ("Msxml2.ServerXMLHTTP.6.0");
objSrvHTTP.open ("GET","http://someipaddress:8080/Publisher/Titles/Paging/0,0,tc?output=json", false);
objSrvHTTP.send ();
Response.ContentType = "application/json";
Response.Write (objSrvHTTP.responseText);
%>
点击test.asp在浏览器中显示的结果是:
<!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=utf-8" />
<title>something</title>
</head>
<body>
{
"Titles": {
"resultCount": 37698,
"moreResources": true
}
}
</body>
</html>
我希望只返回正文标记之间的数据,或者更好的是只返回“resultCount”的值。任何帮助将非常感激。
【问题讨论】:
标签: json asp-classic xmlhttprequest