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

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


  • Subject: Getting WebView and JavaScript to communicate. MFC can do it.
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Tue, 10 Jan 2006 22:15:21 +0000

Hi people,

I've got a WebView control displaying some web pages containing some complex JavaScripts.

I'm trying to get JavaScript to be able to ask my app for a string, and then also to be able to tell the app to store a string. So Javascript like this:


window.external.CB_SetValue(dataElementName, theNewValue);

value = window.external.CB_GetValue(dataElementName);

would be able to access data from my app.

How can I do this in WebView?

It's possible to do in MFC, although complicated. MFC allows you to hook into the JavaScript interpreter and return values or get values.

I looked through the documentation but saw no evidence of an inbuilt way to do this.

Is it possible that I *can't*? If so, is there a work around? Maybe some kind of cookies? The data does not need to be generated at realtime. The data is prefs, so the prefs are loaded before the javascripts are loaded, and saved after the html closes.

I know very little about WebView, except that it should be quite powerful seeing as Safari uses it.

Thanks for your help everyone!
_______________________________________________
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


  • Follow-Ups:
    • Re: Getting WebView and JavaScript to communicate. MFC can do it.
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Cocoa control in carbon window
  • Next by Date: Re: Checkbox, Dictionary, Bindings
  • Previous by thread: Re: Sync Services: role of client type
  • Next by thread: Re: Getting WebView and JavaScript to communicate. MFC can do it.
  • Index(es):
    • Date
    • Thread