You are on the right track, but you are approaching a little. You do not need or want this to be an HTTP URL. Make your url cancel:
<a href="cancel:">Thing to click</a>
Then do webView:shouldStartLoadWithRequest:navigationType: in your business web view. Something like this (untested):
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if ([request.URL.scheme isEqualToString:@"cancel"]) { [self dismissModalViewControllerAnimated:YES]; return NO; } return YES; }
Rob napier
source share