admin管理员组文章数量:1418411
When you open a site with Chrome it shows a message in status bar telling "Waiting for MyHost name" plus it shows Ajax Loader circle in the caption of the tab. Now I have the following javascript function:
function listen_backend_client_requests() {
$.get('/listen?cid=backend_client_requests', // an url to nginx http push channel, http connection stays opened for a long time until the actual data starts to arrive
{},
function(r) {
alert('check');
if (r == 'report_request') {
report_request();
}
listen_backend_client_requests();
}
, 'json');
}
The "$.get(...)" operation is "long polling"(via nginx http push module). It doesn't receive data instantly but waits until the data is published to a channel. And during all this time (may take up to 15 minutes) Chrome shows 'waiting for My host name' in the lower left part of the window and also shows Ajax Loader circle. I dont want them to be shown not in Chrome but neither in any other browser and I have no idea how to do that...
P.S.
By the way, I know that google docs are using the same scheme, but some how their site causes the browser not to show the message. Any suggestions?
When you open a site with Chrome it shows a message in status bar telling "Waiting for MyHost name" plus it shows Ajax Loader circle in the caption of the tab. Now I have the following javascript function:
function listen_backend_client_requests() {
$.get('/listen?cid=backend_client_requests', // an url to nginx http push channel, http connection stays opened for a long time until the actual data starts to arrive
{},
function(r) {
alert('check');
if (r == 'report_request') {
report_request();
}
listen_backend_client_requests();
}
, 'json');
}
The "$.get(...)" operation is "long polling"(via nginx http push module). It doesn't receive data instantly but waits until the data is published to a channel. And during all this time (may take up to 15 minutes) Chrome shows 'waiting for My host name' in the lower left part of the window and also shows Ajax Loader circle. I dont want them to be shown not in Chrome but neither in any other browser and I have no idea how to do that...
P.S.
By the way, I know that google docs are using the same scheme, but some how their site causes the browser not to show the message. Any suggestions?
Share Improve this question asked Mar 4, 2011 at 12:23 Lu4Lu4 15k16 gold badges83 silver badges139 bronze badges 2- IMHO this is a bad idea. If a webpage could control, what my browser gives as status messages, I could download tons of data to the users PC, without let him knowing. My Operas default setting doesn't even allow the change of status-bar-content. Nor any else "strange" script-actions, like replacing the context-menu or changing window-size… I am the user - and its my browser, so let him tell me whats happening! – feeela Commented Mar 4, 2011 at 13:42
- The browser shows that there's some activity on the page, when there isn't one... – Lu4 Commented Jul 19, 2012 at 10:39
2 Answers
Reset to default 2Have you tried setting window.status
? Although I'm not sure I would remend it, it probably would do what you want. Just be sure to reset the status when appropriate.
I've found solution to my problem in contrast to the following posts
How do I implement basic "Long Polling"? Sending messages to server with Comet long-polling Browers entering "busy" state on Ajax request
my problem was that I was starting the long poll ajax request before my page was actually loaded and this fact prevented browser from "waiting for" state...
Just start your long polling process after you have your page pletely loaded...
本文标签:
版权声明:本文标题:javascript - How to prevent my browser from showing "waiting for MyHostName" message during ajax PostGet opera 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745275046a2651133.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论