safari could not open the page because the server stopped responding - javascript

I have one page which takes some time to load in asp.net website. It works with all Android OS, all MAC OS, all iOS except iOS with version 10.0.0.2 with safari browser
When I am trying to load same page with safari in iOS 10.0.0.2, it throws 'safari could not open the page because the server stopped responding'.
I know the reason for this error is, my page is taking time. But my page is already optimized and it has so many things, that's why it is taking time.
I want to prevent my page from this error in 10.0.0.2.
I tried all the possible ways to solve this issue like :
Clear cookie and browsing data
Added 8.8.8.8 to DNS server
Airplane mode on-off
iPhone restart
But nothing helps.
Please help me to figure out this issue.

I found that iOS 10.0.0.2 has default timeout approx 1 minute. My page was taking more than 1 minute to load. That's why safari assumed that server is not responding and it was throwing that message.
I did not get any setting or anything to extend timeout limit of safari. At the end I optimized my code.
I am using telerik rad grid in my page and its MasterTableView's property named 'HierarchyLoadMode' was set as 'client'. I changed it to 'ServerOnDemand'.
That solved my issue by reducing page load time.
As
1) 'Client' loads grid data at the time of page load.
2) 'ServerOnDemand' loads grid data at the time of grid expanding
My page load time has been reduced and safari stopped throwing message.
If you are using telerik rad grid, I hope this will help you.

Related

Page freezes on Mobile

I'm testing on a webpage which displays a list of products, with photos, names, prices, etc. It works fine when I views it on my PC. When I visits the same page on mobile phones (Android and iPhone), the page first loads all its contents, and then freezes for few seconds, and then works again. When it freezes, I tried to scroll the screen up and down and it does nothing, and then after few seconds, it responds with all these actions. Any guess on what causes the freeze? There is some JS runs when the page loads, but it works just fine on browsers on PC.
It depends on your code. If you are displaying high resolution images on the device, it will slow down the scrolling. Also if you are downloading any data on the main UI thread, it will also cause the freeze which you are experiencing.
Sometimes on mobile if you're loading a lot of items or data at the same time it can take mobile phones a second to render all the new information. Perhaps loading less information could be a solution?

cannot open simultaneously 2 tabs within same web app on safari ipad/iphone using SignalR

The web app is powered with require.js, jquery, underscorejs, signalR. MVVM with knockoutjs.
Working within one tab is fine. Trying to open a part of application in new tab, does not work. Looking in safari web inspector displays that different scripts / css are endless loading. If I switch back to first opened tab it still works fine and can be reloaded. If i close the first tab, the second is loaded then fine (without reloading, seems like it waits for something in the first tab).
Thank you for any help.
Edit:
I found that the reason is SignalR - after disabling it the second tabs works well. This is strange, because the ipad limit is 5 concurrent connections, and signalR keeps one open.
Any ideas ? SignalR is 1.1.2
Found the reason: IOS Safari is limited to one active connection per server, that causes second tab to wait until first is closed.
Using long pooling fixed the issue:
$.connection.hub.start({ transport: 'longPolling' });

Get rid of [dynamic] JavaScript views in Visual Studio

Since I installed Visual Studio 2010 from scratch about 2 months ago, it behaves slightly different when debugging JavaScript code being run in IE.
When I set a breakpoint, it opens a duplicate of the view with the term "[dynamic]" in the header and marks the breakpoint in there.
When a JavaScript error happens during execution, it does the same before it marks the line of code that threw the error.
This "dynamic" view is editable but edits have no effect - they are not saved to the file.
I find this behavior pretty uncomfortable. Everytime I notice an error in the code during debugging, I happen to fix it in the dynamic view. I hit save. VS does not complain. Next I refresh the page in IE, and - bang - the changes are lost, it loads the untouched old version again.
I haven't been able to find out how I can turn these views off. Before I re-installed Visual Studio it did not do that. It would only create "dynamic" views for script found in inline script tags in HTML files.
Try this
IE > Internet Options > Settings (under browsing history) > Check for new version of stored pages : Every time I visit the webpage.
This works for me in IE10.
Other option is to open Developer tools and select cache option Always Refresh from Server as show in the image below
Try hitting CTRL+F5 on the web page. That did the trick for me.
The problem was that I had opened other IE windows from a previous debugging session, so the dynamic javascript files were still cached.
Having developer tools open - F12 - should also cause the cache files for the page to be cleared on each refresh.
Changing the encoding of the JS file in question, from a Windows codepage to UTF-8, fixes this for me.
Narrowing it down, it appears that OEM Extended ASCII characters in the file (e.g. ALT-254 which I use for a bullet) trigger the problem with the Windows codepage files.
(Visual Studio 2013 Update 5, IE11)
For Google Chrome:
Open developer tools(F12)
Open Network Conditions Tool
Select Disable Cache
I had the same problem of not being able to hit a break point in new code. And breakpoints on old code in the same page will bring up the [dynamic] version. The edited page is not reloaded. This just started for me a week ago in both VS2012 and VS2013. Using refresh page and/or Ctl-F5 did not work for me. BUT, reading this thread pointed me to using F12 to open Developer tools. Leaving that window open, while hitting refresh does the trick. Thanks guys.
1) Run the page Without Debugging (Debug-->Start Without Debugging)
2) While the web page is open in Internet Explorer, press Ctrl-F5 so
that the IE cache is cleared. Ensure IE has the focus.
3) Close IE and re-run the page with Debugging (Debug-->Start
Debugging).
This fixed the issue for me.

Window.location intermittently fails to load in IE

I have an aspx page with JS calling window.location.reload(true) to force refresh a page when a function is called.
This appears to work a few times, with the page reloading as expected, but gets to a scenario where the function is called (i.e. alert in the function is visible) but the reload does not occur. I've also tried setting window.location with the same outcome - it works 2 or 3 times then fails.
This does not occur in Firefox (16), but is happening in different versions of IE (7 & 9)
Using Fiddler to monitor the browser traffic, all is as expected when the reload is working, but there is no traffic reported when the reload stops, suggesting the browser is not sending the request to the server? The IE window does go blank with the loading spinner spinning, but eventually IE displays the error page:
Internet Explorer cannot display the webpage
Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.
This appears to lock the browser. Trying to hit another website results in the same output in Fiddler (nothing). Opening a new IE window means I am able to hit the site with no problems.
This was initially causing a problem updating UpdatePanels via __doPostBack so this JS reload of the page was seen as a quick workaround, but this does not seem to be the case.
I would tend to think this is server related, but I have been unable to replicate the issue in Firefox. This does however unfortunately have to work in IE.
Any ideas much appreciated!
JS snippet below (though this is pretty simple stuff)
function ReloadWindow() {
alert(window.location); // Can see this alert, even when page fails to reload
window.location.reload(true);
}

Web Browser Kiosk - Recover From Network Outage

I am running Firefox as a non-interactive kiosk type application that iterates through several web pages on different sites. For implementation, I have a page that uses JavaScript to iterate through an array of location.hrefs.
I want my kiosk page to be able to auto-recover when there is a network outage between my kiosk application and my web server. Currently, the application has to be restarted if there is an outage. Is there any way to implement this in ANY browser?
It really depends. If the application is non-interactive it should be pretty simple. Just use two frames, load your application in one and have it change the URL in the other frame periodically. This way, the first frame never refreshes, so in case of a network outage it will keep cycling through the pages (although they will appear as errors) until the network is back (at which point the app will be back to normal on the next refresh).
Note that you don't have to show two frames. The first frame that only contains the required JavaScript to cycle through your pages can easily be invisible.
You could probably do more complicated stuff, such as polling with Ajax before a page change to see if you have a connection, but it's up to you to decide whether that is necessary.
Set your page as home page and add Firefox to the Autostart folder.
For the kiosk mode, I found an addon that claims to be helpful of this. Haven't tested it myself though...
EDIT (Thought it was your site that should restart)
For the problem with sites in your switcher that stops responding I would do something like doing an ajax call to the page first and checking the http status. If it's ok - load the page in the content area (iframe?), if not, move on to the next page. The pages will be checked every time in the loop, which means a down page will be displayed when it comes back up.
Quite sketchy, but I hope you get the point?
I have a similiar setup. I used Tab slideshow ( https://addons.mozilla.org/sv-se/firefox/addon/tab-slideshow/ ) in combination with ScrollyFox ( https://addons.mozilla.org/sv-se/firefox/addon/scrollyfox/ )
I have Slideshow setup so that it reloads the tabs every 30 second or so. I have one tab for each site that I want to demonstrate, and tab slideshow will cycle through them at a certain interval. Upside with this approach is that they will usually be fully loaded all the time.
For fullscreen in firefox 4, just F11 and then Alt + F4 and it will start up in full screen the next time it will load. I used Full Fullscreen for this before, but it hasn't been upgraded to support FF4 yet. It works in 3.6 though.

Categories

Resources