I have multiple xmlHttpRequest
on my page, and I am attempting to call the abort()
method on them all. Works great in FF. IE, on the other hand does not do a darn thing. The connections do not close, and I am unable to navigate to another page until the requests complete. What is this? Why doesn't IE close the connections when abort()
is called?
相关问题
- Carriage Return (ASCII chr 13) is missing from tex
- How to fix IE ClearType + jQuery opacity problem i
- Using :remote => true with hover event
- Is there a way to play audio on a mobile browser w
- net::ERR_EMPTY_RESPONSE when post with ajax
相关文章
- spring boot用ajax发送请求后,请求路径多了controller的路径
- 针对复杂结构的前端页面,如何更好地与后台交互实现动态网页?
- ajax上传图片,偶尔会出现后台保存的图片有错误或者已损坏,请问可能是什么原因造成的?
- 前端 我想知道怎样通过发ajax请求向服务器拿到数据然后分页显示 最好是点击一页就发一次请求
- 接口返回的数据格式如下,请问可以取到level值为2的name数组呢
- 如何通过页面输入账号密码提交给后端
- How to get jQuery.ajax response status?
- How to read local csv file in client side javascri
Parallel-Ajax requests vs Apache-Session locking
Session data is usually stored after your script terminated, but as session data is locked to prevent concurrent writes only one script may operate on a session at any time.
When e.g. using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as possible.
So you can use sessions in ajax scripts with
session_start();
(maybe handled automatically) followed immediately (soon as possible) bysession_write_close();
session_write_close();
will "end" the current session and store the session data.But:
session_id()
will still deliver the correct (current) PHPSESSID so you're able to re obtain write access to the current session by simply doingsession_start()
again at any time you need it.I use it this way in all my ajax scripts to implement session handling and allowing parallel request (with aborting) in all browsers
I've almost never gotten abort to work in IE. I'm tired and can't remember why - something about not being able to abort until you're in readyState 4 (or maybe that it changed to readyState 4 when it aborts?). Either way, Ajaxian has a work around in the depths of its' archives:
http://ajaxian.com/archives/reusing-xmlhttprequest-without-abort