Getting WebView and JavaScript to communicate. MFC can do it.
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