views:

252

answers:

1

In an application that has multiple webviews, is there any way to have the JavaScript in two separate webviews communicate with each other directly? I would really like to use JavaScript in one webview to control the contents of the other webview, but my bet is that each environment is completely isolated and that communication has to be serialized and sent through the webview controller.

A: 

Use <frameset>, <iframe> etc in the same web view to communicate between two pages.

Otherwise, there's no way to see outside of the environment (esp. for iPhoneOS since the whole WebKit framework is a private API.)

KennyTM
Shoot. That's too bad. At the heart of my problem is that I need multiple webviews, each that can scroll independently. Right now, I'm using one wide webview that has side-to-side scrolling managed by a scroll controller to move between "pages" of data and up-and-down scrolling controlled by the webview. Side-to-side works smoothly, but up-and-down is very, very difficult to control. I was thinking of serializing the HTML fragments and passing them via the webview controller to the webviews that need them, but binding events is going to be very difficult to manage.
Andrew