I am trying to call a javascript function from loaded local html file in UIWebView
but it deosn't respond
it look like this
NSString *script=[NSString stringWithFormat:@"sample()"];
if (tekst.loading) {
NSLog(@"Loading");
} else {
NSLog(@"Fully loaded");
[tekst stringByEvaluatingJavaScriptFromString:script];
}
and in html
<head>
....
<script type='text/javascript'>
function sample() {
alert('Paznja');
}
</script>
...
</head>
stringWithFormat:here. Just assign the string literal directly: NSString *script = @"sample()";