我确实要求:
我收到 XML:
<?xml version="1.0" encoding="UTF-8"?>
<search>
<location id="18171" client_id="511">
<site>3</site>
.....
刷新浏览器后,我收到:
<?xml version="1.0" encoding="UTF-8"?>
</search>
只有当我关闭并打开浏览器时,我才会收到
<?xml version="1.0" encoding="UTF-8"?>
<search>
<location id="18171" client_id="511">
<site>3</site>
为什么?我不想每次都关闭和打开浏览器
谢谢
我的代码:
function makeRequestXML(url) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Giving up :( Cannot create an XMLHTTP instance');
return false;
}
http_request.onreadystatechange = ContentsXML;
http_request.open('GET', url, true);
http_request.send(null);
}
function ContentsXML() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
number_checkbox = 0;
var xmldoc = http_request.responseXML;