Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script language="javascript">
- alert("Hell! UIWebView!");
- </script>
- - (void)login {
- NSString *requestText = [[NSString alloc] initWithFormat: @"%@?user=%@&password=%@", DEFAULT_URL, user.name, user.password]; // YES, I'm usin GET request to send password :)
- NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:requestText]];
- [webView loadRequest:request];
- }
- webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:
- @interface UIWebView (JavaScriptAlert)
- - (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- @end
- @implementation UIWebView (JavaScriptAlert)
- - (void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame {
- UIAlertView* dialogue = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil];
- [dialogue show];
- [dialogue autorelease];
- }
- @end
Add Comment
Please, Sign In to add comment