• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Running JavaScript in iOS WebView.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running JavaScript in iOS WebView.


  • Subject: Re: Running JavaScript in iOS WebView.
  • From: Laurent Daudelin <email@hidden>
  • Date: Wed, 17 Nov 2010 14:01:37 -0800

On Nov 17, 2010, at 13:33, Geoffrey Holden wrote:

> I've written an app for the Mac (which runs rather nicely) and now I'm trying to port it to iOS (where it won't run at all).  The particular line of code which is causing a problem is this:
>
> 	[webView stringByEvaluatingJavaScriptFromString:cmdStr];
>
> cmdStr contains the following: rcs.invoke(dojo.fromJson('{"pw":"password","type":"signIn","email":"email@hidden"}'));
>
> I'm using the JSON framework on Google code (http://code.google.com/p/json-framework/), which (I'm assured) is iOS compatible.  It certainly builds without trouble.
>
> The error I get when this line (fails to) execute is:
>
> void SendDelegateMessage(NSInvocation*): delegate (webViewDidLayout:) failed to return after waiting 10 seconds. main run loop mode: GSEventReceiveRunLoopMode
>
> I have got webViewDidFinishLoad (that's where this code is called) - so it isn't that it's trying to run on nothing.
>
> If you have any ideas about what I could do to fix this, I'd be most interested to hear them!

Must be something with the JSON framework, maybe the syntax is incorrect, because I just started using a WebView with stringByEvaluatingJavaScriptFromString: and it works flawlessly like the WebView for OS X. In my case, the code I execute is much simpler, things like "document.forms[0].user.value=\"%@\". No problem with this kind of scripting but, like I said, it's very basic...

-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 				http://www.nemesys-soft.com/
Logiciels Nemesys Software              				email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Running JavaScript in iOS WebView. (From: Geoffrey Holden <email@hidden>)

  • Prev by Date: Re: NSTimer firedate randomly changes
  • Next by Date: Re: NSTimer firedate randomly changes
  • Previous by thread: Running JavaScript in iOS WebView.
  • Next by thread: Re: Running JavaScript in iOS WebView.
  • Index(es):
    • Date
    • Thread