I want to trigger a simple UIAlertView from the html-page loaded within a UIWebView (using html or javascript).
Is there a way to catch events happening on the webpage loaded inside a uiwebview and pass them along to the source-code of the application?
This is the simple alert I want displayed:
...when, for instance a button is pressed inside the webpage:
An easier way would have been to call a javascript-alertbox. However, I can't get it to work inside a uiwebview and that makes me think that it probably is not supported:
}
Is there a way to catch events happening on the webpage loaded inside a uiwebview and pass them along to the source-code of the application?
This is the simple alert I want displayed:
Code:
UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Hello" message:@"Wazzup" delegate:self cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
...when, for instance a button is pressed inside the webpage:
Code:
function disp_alert()
{
// SOMEHOW CALL myAlert..
}
<form>
<input type="button" onclick="disp_alert()" value="Display alert box" />
</form>
An easier way would have been to call a javascript-alertbox. However, I can't get it to work inside a uiwebview and that makes me think that it probably is not supported:
Code:
function disp_alert()
{
alert("Hello, wazzup");
}
<form>
<input type="button" onclick="disp_alert()" value="Display alert box" />
</form>