I am doing a long survey using JSONP, and firefox constantly pops up using "Loading", which makes the page look like it didn’t finish loading. Is there any way to suppress this?
I was told that the Orbited team has hacks to suppress this, but looking at the Orbited.js code, I cannot understand what it is. Any help would be greatly appreciated.
This is a simple fix. All you have to do is run your poll request using setTimeout ..
, . jQuery, , , , , .
<script type="text/javascript"> function poll(){ $.getJSON('/updates', function(json){ //reconnect since we successfully received data and disconnected poll(); //add something here to do whatever with the recieved data }); } /*call the poll function after document has loaded with setTimeout if called before the document finishes loading completely it will cause a constant loading indication*/ setTimeout(poll, 1); </script>
, . - .
, , Cross-Origin XMLHttpRequest JSONP .
( , ) CORS, , , .
Source: https://habr.com/ru/post/1739362/More articles:Choosing an MVC Viewer - asp.net-mvcКак GC собирает ресурсы в статическом члене в .NET? - garbage-collectionC ++ Universal Data Type - c ++How to upgrade an existing EDMX 1.0 model to a new EDMX 2.0? - .net-4.0Rabin fingerprint using .NET - .netLinq to Entities Convert DateTime - datetimesvcutil, WSDL, and the created interfaces are not sufficient for implementation - wsdlA jsonp comet hanging request causes an ugly “download” state in browsers - javascriptUIWebView NSURLRequestReloadIgnoringLocalCacheData does not actually ignore the cache - cachingCan an ontology appropriately replace an RDBMS for a web application? - web-applicationsAll Articles