IOS6 Safari Ajax Spinner - ios

I can make a CORS Ajax post work fine on IOS6, but there are some very weird behaviours in regards to the little spinner that indicates that the browser is loading something despite the request completing.
I have provided a live page that demonstrates this behaviour here
And the source for the node.js + express server is available here
Note this only occurs on IOS6, in addition it behaves inconsistently between tabs, for example you can navigate to another page on same tab and it will continue to spin, but open a second tab, load the page, then close the first tab and it goes away.
Also if you run the test page, then go to a different site using the same browser tab, the spinner will continue to spin on the new site.
So what I'm looking for is some hack that might make this behave in a sensible way, I'm not interested in not using Ajax, CORS or POST.
Thanks for taking the time and having a look.
Update: Apple have confirmed the issue but nothing more, so will just wait and see if next release fixes it. I am going to stop the test server but leave the files available.

I just came across this issue independently today too. I reduced my test case and found that this only happens on CORS request that trigger preflight requests. So it leads me to believe that it's related to two requests firing off in succession. OPTIONS and then whatever method your request is.
It also doesn't matter at what stage you firing off the request as soon as a preflight CORS request is triggered the spinner never goes away.
UPDATE: Just tried the iOS7 beta and this bug is still present.

Put this in your code.
$(document).ready(function(){
getUpdates();
});
function getUpdates() {
$.post("status.jsp", {}, function(status){
// do client-side rendering here
setTimeout(getUpdates, 5000);
}, "json");
}
Go to this site for more info.
http://www.devthought.com/2012/09/22/understanding-the-ios6-ajax-bugs/

Related

Why would my MC3 Web application be making two gets with just the one action method?

When I check with fiddler I can see the following. That appear immediately after each other.
GET /C01C/Page1?_=1346588295451 HTTP/1.1
GET /C01C/Page1?_=1346588295613 HTTP/1.1
When I step through with the debug it only stops once at the breakpoint in my razor page.
Yet I see two requests and there are numbers after the URL. Does anyone have any clues. I can see this in fiddler and also in network tab of the IE debug panel.
I realize now that I was using an Ajax get and I had set up a ().on event. There were two of these events hanging off the same ID so it got called twice.

With firebug stop loading so can see requests

I am trying to analyze a POST request using firebug. Using the net panel I can see the request, however when the POST has success the page then reloads and I only have a couple of seconds to actually look at the request and see what is going on. Is there a way I can pause it much like when analyzing scripts using this tool?
There is a "Persist" button on some of the tabs in Firebug. Just make sure to click it before doing your post.
[edit] Second row, third button from the left, on the Console and Net tabs.
Even better, if you're on Windows you can use Fiddler - an amazing and free HTTP debugger developed by some important guy on the Microsoft IE team.
With it you can conditionally intercept GET or POST requests, inspect and change parameters, break on responses, change responses (headers or body), reissue old requests and generally screw with your application during development.
Simply one of the most useful web development tools. Ever.
May require a little tweaking for localhost - see here
One solution would be to remove the refresh of the page from your code.
Then run your code to see the results.
You can use web developer tools plugin for Mozilla firefox, and disable meta redirects

Dont allow timeout on a page, though it is in an application that has a timeout

I am working on a .jsp page that is in an application that has a timeout for any page in that application. Is there any way around this, or would it have to be created in a separate application. I know this is usually done in the xml file, but was curious if there was any other option?
One option would be to poll back to the server and hit a page that would re-set the timeout timer. This could be done with some fairly simple javascript, and jQuery makes it even simpler.

issue with firefox tamper data plugin

I am facing this problem while debugging a website.
Plugin used: tamper data for fire fox;
Possibilities: its a ajax request.
as you see in the image the tamper dialog dose not show anything for this request. for other request it shows the general options.
any known issue with this.
And I also want to know if any other better tool available for analyzing websites(live or remote, not on localhost)
Tamperdata is the buggiest thing ever made, even the UI takes 50 clicks to do anything. Look for another tool. I personally use HackBar to send simple POST/GET requests (there's a version that can modify cookies per request too I think), and Wireshark or livehttpheaders (although livehttpheaders is also buggy) when I need to analyze traffic.

jquery .ajax request blocked by long running .ajax request

I am trying to use jQuery's .ajax functionality to make a progress bar.
A request is submited via .ajax, which starts a long running process. Once submited another .ajax request is called on an interval which checks the progress of this process. Then a progress meter is updated using this information.
However, the progress .ajax call only returns once the long running process has completed. Its like its being blocked by the initial request.
The weird thing is this process works fine on dev but is failing on the deployment server. I am running on IIS using ASP.Net MVC.
Update: Apparently, it is browser related because it is working fine on IE 7 but is not working on IE 8. This is strange because IE 8 allows up to 6 connections on broadband where IE 7 only allows 2 requests per domain.
Update2: I think it's a local issue because it appears to be working fine on another IE 8 machine.
The server will only run one page at a time from each user. When you send the requests to get the progress status, they will be queued.
The solution is to make the page that returns the status sessionless, using EnableSessionState="false" in the #Page directive. That way it's not associated with any user, so the request isn't queued.
This of course means that you can't use session state to communicate the progress state from the thread running the process to the thread getting the status. You have to use a different way of keeping track of running processes and send some identifier along with the requests that gets the status so that you know which user it came from.
Some browsers (in particular, IE) only allows two requests to the same domain at the same time. If there are any other requests happening at the same time, then you might run into this limitation. One way around it is to have a few different aliases for the domain (some sites use "www1.example.com" and "www2.example.com", etc)
You should be able to use Firebug or Fiddler to determine how many requests are in progress, etc.
Create an Asynchronus handler (IHttpAsyncHandler) for your second ajax request.
use any parameter required via the .ashx querystring in order to process what you want because the HttpContext won't have what you'll need. You barely will have access to the Application object.
Behind the scenes ASP.NET will create for you a thread from the CLR pool, not the application pool, so You'll have an extra performance gain with IHttpAsyncHandler

Resources