Skip to content

Instantly share code, notes, and snippets.

@d6rkaiz
Created February 21, 2011 07:29
Show Gist options
  • Save d6rkaiz/836774 to your computer and use it in GitHub Desktop.
Save d6rkaiz/836774 to your computer and use it in GitHub Desktop.
JavaScript Alert & Confirm
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message
{
NSRunAlertPanel(@"JavaScript alert", message, @"OK", nil, nil);
}
- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message
{
int choice = NSRunAlertPanel(@"JavaScript confirm", message, @"OK", @"Cancel", nil);
return choice == NSAlertDefaultReturn;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment