同步模式下的Ajax适用于IE,不适用于Firefox [英] Ajax in sync mode works with IE, does not work with Firefox

查看:62
本文介绍了同步模式下的Ajax适用于IE,不适用于Firefox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ajax在同步模式下编写应用程序 - xmlHttp.open(GET,

url,false)。

我注意到在FireFox处理程序中没有不会开始。它开始于我使用

xmlHttp.open(GET,url,true)。

我需要在同步模式下使用它。任何想法我该怎么办?


谢谢,


Zalek。

I am writing application with Ajax in sync mode - xmlHttp.open("GET",
url, false).
I noticed that in FireFox handler doesn''t starts. It starts when I use
xmlHttp.open("GET", url,true).
I need to use it in sync mode. Any ideas what can I do?

Thanks,

Zalek.

推荐答案

8月29日,3:55 * am,zalek< zalekbl ... @ hotmail.comwrote:
On Aug 29, 3:55*am, zalek <zalekbl...@hotmail.comwrote:

我正在用Ajax编写应用程序在同步模式下 - xmlHttp.open(" GET",

url,false)。

我注意到在FireFox处理程序中没有启动。它开始于我使用

xmlHttp.open(GET,url,true)。

我需要在同步模式下使用它。任何想法我该怎么办?
I am writing application with Ajax in sync mode - xmlHttp.open("GET",
url, false).
I noticed that in FireFox handler doesn''t starts. It starts when I use
xmlHttp.open("GET", url,true).
I need to use it in sync mode. Any ideas what can I do?



回调不会被调用同步XHR请求(没有

需要来自。)


但是(AFAIK)没有什么可以阻止你调用它(手动)如果你需要的话,那就是.bn b之后的内容。 (,, false):


//xmlHttp.onreadystatechange= myCallback;

xmlHttp.open(" GET",url,false);

myCallback();


--Jorge。

The callback won''t get called for synchronous XHR requests (there''s no
need to).

But (AFAIK) nothing prevents you from calling it ("by hand") if you
need to, inmediatly after the .open(,,false) :

//xmlHttp.onreadystatechange= myCallback;
xmlHttp.open("GET", url, false);
myCallback();

--Jorge.


8月29日,2 :55 * am,zalek< zalekbl ... @ hotmail.comwrote:
On Aug 29, 2:55*am, zalek <zalekbl...@hotmail.comwrote:

我正在用同步模式的Ajax编写应用程序 - xmlHttp.open(" GET" ;,

url,false)。

我注意到在FireFox处理程序中没有启动。它开始于我使用

xmlHttp.open(GET,url,true)。

我需要在同步模式下使用它。
I am writing application with Ajax in sync mode - xmlHttp.open("GET",
url, false).
I noticed that in FireFox handler doesn''t starts. It starts when I use
xmlHttp.open("GET", url,true).
I need to use it in sync mode.



为什么需要在同步模式下进行AJAX通话?在收到服务器的回复之前,IT只会停止执行其他操作...

所以,除非得到回复,否则不要做任何其他事情......

或许我误解了你要做的事情...

WHY do you need to make AJAX call "in sync mode"? IT will only stop
doing anything else until it gets a response from the server...
So, just DO NOT do anything else until you get a response...
Or maybe I misunderstand what you are trying to do...


任何想法我该怎么办?


谢谢,


Zalek。
Any ideas what can I do?

Thanks,

Zalek.


zalek写道:
zalek wrote:

我正在用同步模式的Ajax编写应用程序 - xmlHttp。打开(GET,

url,false)。

我注意到在FireFox处理程序中没有启动。它开始于我使用

xmlHttp.open(GET,url,true)。

我需要在同步模式下使用它。任何想法我该怎么办?


谢谢,


Zalek。
I am writing application with Ajax in sync mode - xmlHttp.open("GET",
url, false).
I noticed that in FireFox handler doesn''t starts. It starts when I use
xmlHttp.open("GET", url,true).
I need to use it in sync mode. Any ideas what can I do?

Thanks,

Zalek.



这是否正确:

如果由于任何原因的回复没有立即出现,例如在20

秒(或从不!)

整个浏览器页面就像死了,键盘死了,鼠标点击没有

效果,用户变得愤怒和绝望,离开你的页面和

永远不会回来。或者......?

Is this correct:
If the response for any reason does not come immediately but e.g. in 20
seconds (or never!)
the whole browser page is like dead, keyboard dead, mouse clicking has no
effect, the user becomes angry and desperate, goes away from your page and
never comes back. Or ...?


这篇关于同步模式下的Ajax适用于IE,不适用于Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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