JavaScript timeout on iPad Safari vs. Win 7 Safari - javascript

I am using the latest version of jqGrid (4.x) for an application displaying local data.
Win7: All works fine on several browsers (Chrome, FF, IE, Safari).
In iPad's Safari the grid works excellent, but there is one issue:
When I unload the grid because I need to redefine its columns, this either takes extremely long or times out. I am using purely local objects - no back-end connectivity involved. Debug console on iPad Safari: JavaScript execution exceeded timeout
I have tried both ways:
$("#myGrid").GridUnload();
$("#myGrid").GridUnload("#myGrid");
I can reproduce the issue, when I skip the GridUnload part the issue is gone. As said above, on a Win7 Safari this is not problem at all.
Any ideas how I could work around the issue?
-- UPDATE ---
This issue was very hard to trace for me, since I am not aware of how to debug JS code on an iPad. So far, this issue seems not to be specific to jqGrid, but the timeout happens whenever something in JS takes to long. For some reasons I do not understand yet, this seems to be the GridUnload().
Can somebody tell me, whenever this Safari iPad Javascript timeout is happening, I have no idea what triggers it.

Related

Mobile Android Chrome not working great with HTML5 and CREATEJS - freezing issues

I have developed an app using HTML5 and CREATEJS. I am encountering some issues that I cannot find a solution, for weeks. I hope someone can help.
1)On Android Google Chrome there is a problem that appears when I simply click anywhere on the screen: the FPS drops and any animation that is playing freezes for the duration of my touch. The problem is only in Mobile Chrome browser, on Android. It does not exist in other mobile browsers, neither in iPhone, neither in Safari, Firefox, etc.
I created a simple apk using webview and it doesn't have the problem either. So for some reason, the problem is only in mobile android chrome.
The code is optimized at maximum. 2 months ago we used only 1 canvas, but now we use multiple canvases and we have less animations in each canvas running everytime. While in android firefox it works perfect, but in android chrome it freezes for a single click.
I tried to disable stagemousedown/up events, because they are being triggered when I simply click anywhere in the stage. This didn't fix the problem or it is possible that there are some hidden stagetouch events that I don't know how to disable.
2)On Android Google Chrome and iPhone6 Safari, when I click the SPIN button, the game starts the SPIN, but with a delay of at least 1.5 seconds, but there is no such delay added with intention inside the code. On PC any browser, Android/iOS Mobile Firefox, this works perfect, no delay. In iOS Safari iPhone8 again it works perfect.
I created a simple apk using webview and it doesn't have this problem either. So for some reason, the problem is only in mobile android chrome.
UPDATE 11/10/19: Issue 2 has been solved by reducing canvas size and removing all shadow effects which consumed a lot of memory. Issue 1 still remains unsolved with absolutely no ideas left to try out. Any help is appreciated.
My project is 99% completed except these 2 issues. I am hoping to be able to fix them, because I really do not want to throw away months of work and switch to other javascript library for gaming, that doesn't have the problem, like PIXIJS.
I tried with RAF and RAF_SYNCHED, but still no improvement in any scenario.
Stage.update() is required for any animation. Having them on ticker is the reason why its getting slower.
To see the problem in action, please open this URL: http://www.nevergone.biz/DEMO_CODE/index.html
How to test: Open the link above in Android Google Chrome portrait mode and then click SPIN. During SPIN click above the game canvas or anywhere. Notice that everything freezes.
The code was extracted only for testing these issues, so after a few spins it may freeze. I will fix this tomorrow, but I hope someone can give some ideas for solving the problem.
Problem #1 is apparently isolated on some older devices that use Android Google Chrome. The problem is somehow caused by CREATEJS using too many listeners on the stagedown event. I am currently waiting for the developer of the framework to give an answer or for Chrome to receive a serious update.
Problem #2 was fixed by removing all text-shadow CSS effects which apparently were consuming a lot of memory.
cache might work.
var testShape=new createjs.Shape();
testShape.graphics.beginFill("red").rect(0,0,100,100);
testShape.cache(0,0,100,100);
stage.addChild(testShape);
// If you make changes and want to refresh the cache
testShape.updateCache()

vue 2.x ios safari crash on render

I can't really paste reproduction here, because it's happening in commercial project. I will try to describe it and maybe someone had same problem.
Vue 2.x, iOS 9.x, iPad and iPod
My page (one of layouts) crashes on Safari/Chrome on iOS, immediatly after page load. On ipad it gets refreshed and works. On iPod it crashes also on other pages and doesn't get refreshed.
Can't debug anyhow. I know there was a problem with ios 9 safari with too much javascript templating/too much js at all.
Do you know anything about that issue? Is it possible to debug it somehow? I thought I just accidentaly trigger some bug in safari, but different behavior in faster/slower devices says it's more like computing bug (iPhone 6s work like ipad)
Help, I cant rewrite everything to jQuery now :D
EDIT:
I initialized vue on DOMContentLoaded and it fixed iPad problem (so problem was maybe conflicts between html rendering by vue and browser), but slow 2014 iPod breaks anyway

Console open in Safari Devtools, but console.log('hello') doesn't work

I use Chrome Devtools constantly, but Safari is new to me.
I'm trying to use Safari 7 to debug a Safari specific site issue, but I cannot make console.log work. The following very basic jsfiddle fails on Safari:
console.log('hello')
As pictured, nothing appears in the 'console' UI.
Safari has lots of ...things.. for me to click on. Do I need to do something to make the console work?
Killing the Safari process in Activity Monitor didn't fix it, but rebooting OS X did.
sigh
To Apple in case they are seeing this:
It's really unfortunate, how easily the console.log gets pushed off its feet in Safari 7 (9537.71). All it takes is i.e. misspelling Math.pow2 (there is no such function in the Math library). Refreshes, console.log no longer responds. On this occasion, restarting Safari brought it back.
Please, make a fix.

What is causing my images to not load initially in safari. All other browsers seem to work fine

I am currently using the 3d cardflip method on my website and it is working perfectly in Firefox, IE, as well as the IE downgrades I have for older browsers. My issue is arising from the fact that it seems that all Apple iOS devices and Safari will not load the images and information on the cards on the initial load of the page but only when a hard reload or a simple reload of the page is performed. I have tried everything I can think of to fix the issue and I have not been able to find any information regarding the issue either. Any help would be gladly appreciated! The page that is not working is http://www.paytonandsam.com/about_sam.html
Please test this website on Safari Version 5.1.5, 6.0.2,6.0.3 i.e. a higher version of Safari browser. Because now safari browser is faster and flexible than the older version.

Firefox Javascript Error / Oddity / Weirdness. Any Explanations?

If you view this page...
http://eastlondondance.org/admin/MozillaProblem/example.php
...you'll find that there are no errors but that the functionality is not working.
The last dropdown is not being populated with options like the other 2. This however works on Safari, Chrome and IE.
What gives? Why isn't it working on Firefox Linux, PC or Mac but is on all other browsers?
Is it a problem with the code or a problem with Firefox?
Any help is much appreciated.
cheers,
George
Firefox is having problems with the variable name of performance. While I'm not certain why this is, renaming this to anything else will allow it to display in firefox. In the example below I renamed it from performance to performancex.
Example: http://benjaminhopkins.co.uk/stackoverflow/firefox.html
From the comments above seems not everyone see the problem? Maybe it could be a extension / plugin causing the issue. Using the developer toolbar and hovering performance firefox reveals the following:
Performance { constructor=Performance,
timing=PerformanceTiming,
navigation=PerformanceNavigation}

Categories