iOS + jqueryMobile无法在加载html文件时捕获webview事件 [英] iOS + jqueryMobile unable to capture webview event when html file is loaded

查看:117
本文介绍了iOS + jqueryMobile无法在加载html文件时捕获webview事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将jqueryMobile html文件加载到webview中,并且正确触发了webViewDidFinishLoad事件.但是,当您选择已加载的jqMb文件的导航按钮以加载另一个html文件内容时,不会触发事件!如何捕捉呢?谢谢

I am loading a jqueryMobile html file into webview and webViewDidFinishLoad event is properly triggered. However, when you select a navigation button of loaded jqMb file that loads another html file content, event is not fired! how to capture it? Thank you

推荐答案

使用伪造的JavaScript调用widow.location = "localFuction"解决.

solved using fake javascript call, widow.location = "localFuction".

然后,触发- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest,如果([[[request URL] absoluteString] hasPrefix:@"localFunction"]) { Return NO

希望这会有所帮助

这篇关于iOS + jqueryMobile无法在加载html文件时捕获webview事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆