Obj-C from JavaScript, Google Map event listeners in a WebView.
Obj-C from JavaScript, Google Map event listeners in a WebView.
- Subject: Obj-C from JavaScript, Google Map event listeners in a WebView.
- From: Erik Sjödin <email@hidden>
- Date: Mon, 16 Jan 2006 18:13:29 +0100
Hi!
I'm trying to execute a objective c method called "test" from a
JavaScript in a WebView. The code compiles fine but "test" is not
executed when the JavaScript is executed in the WebView.
I'm also trying to get google maps event listeners to work in my
WebView, I've tried both GEvent.addListener and GEvent.bind without
succes. My gmap loads fine in the WebView otherwise and the listeners
work in Safari...
Any Ideas?
----- objective c code:
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame {
id win = [webView windowScriptObject];
// alloc an instance of the mapManager class
MapManager *mapManager = [[MapManager alloc] init];
// publish mapManager to webView
[win setValue:mapManager forKey:@"gMapManager"];
}
------ javascript code:
<script type="text/javascript">
// exc. obj-c method
if (gMapManager) { gMapManager.test(); }
</script>
thanks! // erik
_______________________________________________
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