IE-7中的XMLHttpRequest [英] XMLHttpRequest in IE-7

查看:82
本文介绍了IE-7中的XMLHttpRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建XMLHttpRequest,如下所示:

I'm creating XMLHttpRequest as follows:

function checkDependencyFormFilledStatus(appName,formName){
    var xmlhttp;
    xmlhttp=new XMLHttpRequest();
    xmlhttp.open("GET","checkFormDependency.action formName="+formName+"&applicationName="+appName,false);
    xmlhttp.send();
    var dependentFormEmptyStatus = Ext.JSON.decode(xmlhttp.responseText);
    alert(xmlhttp.responseText);
    return dependentFormEmptyStatus;
}

对象返回的响应取决于操作类正在使用的数据库.

The response returned by the object is dependent on the database which the action class is using.

这在Firefox 10.0中工作正常.

This works fine in Firefox 10.0.

但是对于IE7,它仅在第一次时返回正确的响应.对于其余的函数调用,它返回相同的响应(无论我们在数据库中进行了什么更改).仅当我关闭并打开标签时,它才会更新其响应(甚至在重新加载页面时也是如此).

But for IE7, it returns correct response only for the first time. And for the rest of the function calls, it returns the same response (no matter what changes we make in the database). It updates its response only when I close the tab and open it (not even on reloading the page).

如何使其在IE 7中正常工作?

How to make it work in IE 7?

推荐答案

响应被缓存的声音.

在URI的末尾添加一个伪随机字符串(例如时间戳记)以缓存突发.

Add a psuedo-random string (e.g. a timestamp) to the end of the URI to cache burst.

这篇关于IE-7中的XMLHttpRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆