Bind html button click with objective c

671 Views Asked by At

I am developing iPad application in which i am loading .html pages in my webView.

One of the page sample.html page contain 2 buttons on click of that buttons i want to write some code in Objective c

In short i want to bind click event of buttons located in .html in `Objective c

Is it possible to write code for the same?

1

There are 1 best solutions below

0
On

Check with url request attribute to identify button click -

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType{

    NSLog(@"url: %@", [[request URL] absoluteString]);

    return YES;

}