I'm getting a NO_MODIFICATION_ALLOWED_ERR error using a jquery library on an iPhone & iPod (but not the iPad Emulator, Chrome, Firefox or Safari). As I understand it, this error is caused by either manipulating the DOM when its not ready or adding invalid XHTML if strict checking is in force (which it seems to be on iPhone from what I gleaned from other searches).
So, my question is - is it possible to get the JS stacktrace on iPhone so I can identify what bit of my code is causing this problem? I have Xcode and the iPhone SDK on a Mac, but I don't have much experience - so if someone could point to some way to use this it would be great.
Thanks, Kevin.
for useful debugging on an iOS device, try this: http://phonegap.github.com/weinre/
it may not give you a good stack trace but it will at least let you inspect the app better.
some code explaining what's going on might be useful.
I don't know of any tracing software but maybe - probably stating the obvious - insert some console.error("Error: ") or console.log("Info..") lines in your code?
Related
I have a javascript slideshow that works on everything except iOS - both Safari and Chrome. I want to see if it's throwing any helpful error messages, but to view Safari error messages, I need to connect the device to a Mac. (I've checked to make sure that Javascript is turned on, of course.)
Are there any other ways to read browser errors in iOS? I've been searching around, but haven't found anything. I'm not familiar with the Apple ecosystem though, so it's quite likely that I'm missing something. (I'm a Windows & Android guy.)
If anyone wants to take a look, the site is www.northerntool.com. It's the big slideshow at the top. (The relevant javascript starts at line 1863 in the source code.)
Thanks for your help!
From user CS54:
(in global.js ) Error: Syntax error, unrecognized expression: #slidebox [class*="slide" –
Thanks!
We have a webapp that is very javascript intensive - a lot of activity with custom markers on google maps and potentially a lot of items on the page.
Intermittently and unpredictably, Safari on iOS will give the 'A problem occurred with this webpage so it was reloaded' error.
The majority of the time, this happens after a photo has been input and resized by the broswer - an upload hasn't happened yet.
In researching potential issues, I've found the following links
https://discussions.apple.com/thread/6707626?tstart=0
https://www.quora.com/When-Safari-says-A-problem-occurred-with-this-webpage-so-it-was-reloaded-what-sort-of-problem-has-likely-occurred
The real question is how do I identify the cause of the crash? This never occurs on desktop so working out if it's an iOS limitation, a memory issue, a resizing problem or another cause is incredibly difficult.
I've connected an iPhone to a Mac to run the web inspector on the phone but this crash just terminates the whole process without logging any errors so there is no help there either.
Also, there is no reliable way to reproduce the issue - it just happens 'sometimes' with no consistent feature as to what the cause may be.
Thanks in advance.
You've tried this? :
connect your Phone to your Mac and
start xcode
open Window->Organizer->Devices tab->Console and see if there are Errors while reproducing the issue.
It may be a newb questions, but still.
I'm working on iOS 6 application for iPhone and iPad, and i'm working on hybrid application Javascript\UIWebView + Objective C
The problem is that i have an internal exception in Private framework. This exception is caused by something that is inside a Javascript\UIWebView. And i don't know what Javascript code causing an exception.
So i wan't to do this:
1) Somehow "skip\shallow" crash
2) Using remote Safari debugger, get some info from application
So my question is, is there a way to "skip\shallow" crash, to make my application work for at least few seconds.
I think your only chance to deal with this is by placing log traces all over your javascript, so you can track down where the crash is happening.
To do this, you might find useful this S.O. post showing how you can have JS log to your Xcode console.
I'm not a Windows Phone developer, and I want as little to do as possible with anything related to Microsoft. Nonetheless, I need to get my mobile web app running properly on Windows Phone 7. What debugging tools are available for the platform? Something like the Webkit developer tools or Firebug would be ideal, either from the phone itself or more likely, remotely debugging from my computer.
If such a thing doesn't exist, I'd settle for being able to read Javascript error messages, and view the contents of variables using alert() or similar. At this point, all I know is that my JS is failing: I don't know where or why, let alone how to fix it.
My dev computer is running OS X, and I'd really like to be able to use these tools from OS X if possible. Assuming that debugging tools exist (which I really hope they do) are they designed for Windows only? If so, does anyone know how well they would work with Wine or similar?
EDIT: I have a physical Windows Phone 7 device, so I can use that. However, alert() doesn't seem to be working, which is why I'm posting this question. Does alert() normally work on the WP7 browser?
You'll likely find the Mobile Perf Bookmarklet to be the easiest all-in-one tool for testing any mobile device.
Works well on the iPhone/iPad/Samsung Galaxy Tab in my testing so far.
Quote:
It displays a menu with links that load other bookmarklets including Firebug Lite, Page Resources, DOM Monster, SpriteMe, CSSess, and Zoompf.
Unless you have a Windows Phone 7 device, you will need to run Windows in BootCamp and install the Windows Phone Developer Tools in order to test in IE on the emulator. I don't know about Whine, but I ran into major problems trying to test in Parallels - so based on my experience, I suggest keeping it as simple as possible.
There is no console in IE on the phone, so you will need to use alert, like you suggested, or just write text to a div on your page as a custom console.
If you really want to code in OS X (which I definitely understand), using a separate machine for testing IE in the WP7 emulator is going to be your best bet.
EDIT: I just tested alert and it did work fine on my Windows Phone. My guess is that a syntax error is preventing it from calling.
The following may be interesting
Simple IE debug tool for Windows Phone
Supports
Html traversing
Html node styles, properties, metrics
Reading console output
Executing js on device side from console (including intellisense)
Dynamic script injection - ability to debug live sites
Not supported
js breakpoints
Just wanted to add a note to say that full JavaScript debugging is possible now with Windows Phone 8.1 and Visual Studio 2013 Update 2. Full details are available at:
http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/04/diagnosing-mobile-website-issues-on-windows-phone-8-1-with-visual-studio.aspx
I realize that this doesn't help the versions referenced in the original question (WP7), but I'm hoping this will help people who may find this question and are running a more recent version.
Something that has worked for me, is to test my mobile pages through the Windows Vista built-in Internet Explorer browser.
It comes with a script debugger ( which you have to enable in Advanced Options tab through the Internet Options menu ), and it seems that it gets really close to the Internet Explorer Mobile implementation.
Another tip would be, that, instead of using window.alerts, you can also use document.write or set output to a div content.
I'm using this hack to have console.log send info back to the server (it uses window.fetch, which I'm polyfilling, but could use xhr instead) https://gist.github.com/wheresrhys/bf93057ee3a594454582
I've downloaded the latest version of IE9 beta and my site wrecks it. No problems on any other browser, but on IE9 it freezes on every page. The thing is, many other sites also make it gag.
Should I worry?
IE's fault or do my site and I need to do some serious soul searching?
How does one debug this stuff and are there a list of common culprits? Is it most likely a Javascript issue? jQuery?
If your site is dying on IE9 (assuming it's not the result of known IE9 bugs), you definitely need to address it. You can download tools like the IE Developer Toolbar to help you move about within your page once it's loaded, and there are other resources online like jslint that will help you examine some of your javascript and work on its quality.
If you find any specific issues that you're unsure of how to address, please don't hesitate to return here and post more questions - there are (literally) thousands upon thousands of brilliant minds waiting to assist you.
Update - You mentioned in the comments below that IE9 dies before you can even determine what is causing it to die. This is (unfortunately) the case with much software. Often times you can try to repeat the same actions in Chrome, Firefox, Opera or some other browser and see how it responds. Many times you'll find that another browser may provide an error without crashing entirely. This could give you some insight into what may be causing IE to crash.
Jonathan submitted a great answer about using jslint to verify the integrity of the JavaScript, and using other debug tools on other browsers to detect for a non-crash error. I did both and thoroughly went through my site, only to find that IE9 was still crashing!
So I looked into it and here's what I found: the main cause of IE9 beta crashes are add-ons that are incompatible with the new release. Adobe PDF viewers, printer add-ons, toolbars, etc. Most everyone has at least one add-on in their browsers. So I disabled all my add-ons and now my site works.
I'm not sure why my site seemed to crash more than others with IE9, but if people are having problems with there site, I'd suggest (1) disabling all add-ons just in case, and then (2) using Jonathan's answer (which I'll leave checked as the official answer since it has to do more with programming).