On Tuesday, July 22, 2003, at 11:41 AM, Darin Adler wrote:
On Tuesday, July 22, 2003, at 06:00 AM, Ronald Jaramillo wrote:
- (void)webView:(WebView *)sender
runJavaScriptAlertPanelWithMessage:(NSString *)message;
Now you can send a message from javascript to your app by using <a
href="javascript:alert('hello there')">Hello</a> in your HTML page.
Of course this will trap all java script alert messages. You could
use a prefix to diference the messages intended to your app and
those for the users fx. " alert('#app# Hello world')" .
We've been suggesting this kind of workaround for people who need
this feature with today's Web Kit, and many people have had really
great results with this technique. Try it out and let us know how it
works for you.
Thanks for the tip. This might work if I'm able to install a filter
that can rewrite the HTML pages before the JavaScript engine gets
them. The filter would find function calls that work on platform "Z"
and put a javascript:alert() envelope around them. I'll keep
experimenting.