Ajax + JSON
来源:互联网 发布:手机库存盘点软件 编辑:程序博客网 时间:2024/05/16 10:25
Myeclipse8.5
index.jsp
<html>
<head>
<title>Ajax: responseJSON</title>
<script language="JavaScript" type="text/javascript">
var http = false;
function doRequest() {
if(!http) {
if (window.XMLHttpRequest) {
http = new XMLHttpRequest();
if (http.overrideMimeType) {
http.overrideMimeType("text/xml");
}
}
else if (window.ActiveXObject) {
try {
http = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
http = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
}
}
}
}
http.onreadystatechange = function() {
if (http.readyState == 4 && http.status == 200) {
var resp = http.responseText
var json = new Function("return " + resp)();
document.getElementById("targetDiv").innerHTML = "得到结果Info:"+ json.info + "; " + "Version:"+ json.version;
}
else {
document.getElementById("targetDiv").innerHTML = "正在处理,请等待";
}
}
http.open("GET", "./AjaxJson.json", true);
http.send(null);
}
</script>
</head>
<body>
<center>
<input type="button" value="Get AjaxJson.json" onclick="doRequest();">
<hr>
<div id="targetDiv">
</div>
</center>
</body>
</html>
AjaxJson.json
{
info: "JSON CONTENT",
version: "1.0"
}
- JSON+AJAX
- ajax+json
- Ajax + JSON
- Ajax JSON
- ajax+json
- Ajax & Json
- json+ajax
- ajax json
- json ajax
- json ajax
- Ajax+JSON
- Ajax&JSON
- Ajax、json
- ajax-json
- AJax json
- ajax&json
- Ajax +json
- Ajax + JSON
- WebApplicationContext : org.springframework.web.context.ContextLoaderListener作用
- 访谈Brad Fitzpatrick——《编程人生》精彩样章,抢先看
- Oracle里面update select 的方法
- 关于C++的重载(overload)
- Oracle里面update select 的方法
- Ajax + JSON
- NRF24l01无线温度传感 收发程序
- 2.Singleton(创建型模式)
- ORA-01704: string literal too long 和 ORA-00932: inconsistent datatypes: expected NUMBER got LONG
- 最经典 VC游戏开发全过程
- forEach
- Eclipse bookmark 使用方法
- 公司服务器瘦身/var占用空间
- 用Lisp解释Lisp