============================ split =======================
function updatePage() {
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText.split("|");
document.getElementById("order").value = response[0];
document.getElementById("address").innerHTML =
response[1].replace(/\n/g, "");
} else
alert("status is " + request.status);
}
}
============================ データ 申請 ===============
var url = "/scripts/getZipCode.php?city=" + escape(city) + "&state=" + escape(state);
=========================== GOOGLE KEY ==================
========================= 生成 方法2=========================
/* Create a new XMLHttpRequest object to talk to the Web server */
var xmlHttp = false;
@*/
(@_jscript_version >= 5)
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
@end @*/
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
=========================== 生成 ajax object ===============================
var xmlHttp = creatXmlHttp();
function creatXmlHttp() {
var newxmlhttp;
if (window.XMLHttpRequest) {
newxmlhttp = new XMLHttpRequest();
}else if (window.ActiveXObject) {
newxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return newxmlhttp;
}
阅读(548) | 评论(0) | 转发(0) |