• 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: Getting WebView and JavaScript to communicate. MFC can do it.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting WebView and JavaScript to communicate. MFC can do it.


  • Subject: Re: Getting WebView and JavaScript to communicate. MFC can do it.
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Wed, 11 Jan 2006 22:24:04 +0000


On 11 Jan 2006, at 22:08, email@hidden wrote:

Theodore H. Smith wrote:


On 11 Jan 2006, at 15:31, Daniel Jalkut wrote:

It's true that the connection has to be made from the Cocoa side, but once it's done, the JavaScript itself has access to the cocoa object. It works something like this:

[myScriptObject setValue:myCoolObject forKey:@"coolCocoaObject"];

Now from this point forward your javascript inside the webview can do something like this:

myCoolObject.DoCoolStuff();

I tried that.

It didn't work!

my setValue and valueForKey methods never got called :(


Also, I don't see this technique documented anywhere in Apple's documentation. And it's not on CocoaDev.com?
I've read it, I think somewhere in the WebKit Programming Guide: Yes check WebScripting, its in the reference, not the programming guide (that I could find)

http://developer.apple.com/documentation/Cocoa/Reference/WebKit/ ObjC_classic/Protocols/WebScripting_index.html

OK I see it.

Although I still can't get it to work.

Apparantly there are some dashboard examples that will help me, because dashboard is actually a bunch of web browser windows. Strange. Well who am I to argue if I get a working example out of it.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Getting WebView and JavaScript to communicate. MFC can do it. (From: "Theodore H. Smith" <email@hidden>)
 >Re: Getting WebView and JavaScript to communicate. MFC can do it. (From: Daniel Jalkut <email@hidden>)
 >Re: Getting WebView and JavaScript to communicate. MFC can do it. (From: "Theodore H. Smith" <email@hidden>)
 >Re: Getting WebView and JavaScript to communicate. MFC can do it. (From: email@hidden)

  • Prev by Date: Can't get WebView to work with JavaScript communication
  • Next by Date: Re: Can't get WebView to work with JavaScript communication
  • Previous by thread: Re: Getting WebView and JavaScript to communicate. MFC can do it.
  • Next by thread: Re: Getting WebView and JavaScript to communicate. MFC can do it.
  • Index(es):
    • Date
    • Thread