Reputation: 8649
I'm facing the following problem : my app has to load some web-content and for some reason the content isn't rendered as it should be,(the web content works perfectly on mobile safari). So I need a way to get notified of javascript error in a UIWebView.
I read thisanswer but I'm actually not able to make it works :(
Could someone,that already did this, please explain me how to do?
Another question is : the UIWebView in iOS 5.x integrate the nitro engine? becaue someone say yes others say no....
Thanks in advance
Upvotes: 4
Views: 4729
Reputation: 20091
I have been running quite a lot of Javascript an invisible webview.
Debugging Javascript on iOS is somewhat tricky. The following I have found helpful, although I have found no silver bullets:
console.log
. I implemented it myself, using the same - (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
everyone else uses. 'undefined' is not a function
with no extra help.- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error;
which as a long shot may report Javascript errors. It doesn't.Things I haven't tried, but are on my list:
Upvotes: 3