English 中文(简体)
通知服务器(XMLHttpRequest?)上载活动?
原标题:notifying the server (XMLHttpRequest?) on the onunload event?

在客户离开该网页时,是否可以通知服务器(用数据线抽取单项吉大港山区的请求,答复不是进口的)?

I m 实际使用Python-tornado 提出申请时,用javascript 不断要求服务器连接(该服务器已关闭并重新开门)。 依据:https://apppad.net/eftw

我没有找到轻松的办法(特别是用火炮进行)。 这使得这一问题非常成问题。

Oh, and the actual Code (既然它有点可使用过: http://bazaar.signpad.net/~hoverhell/xftw/trunk/files

最佳回答

视浏览器和排位而定,您的Xml HttpRequest可能在其实际完成之前被杀。

浏览器的决策者希望(确切地说,仇恨)使下页尽快到位。 <代码>on beforeunload和onunload均为清理活动,旨在迅速处置围绕任何变量,不再意味着等待......浏览器。 由于新浏览器的垃圾收集工作也显著改善,浏览器更没有理由等待这些事件。

您可在<代码>window.on beforeunload活动上发出一项请求,......但能否进入服务器? Maybe。

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签