【发布时间】:2013-10-11 03:48:19
【问题描述】:
我不确定我是否走在正确的道路上,但我注入了一些 javascript 以便在 UIWebView 中发生touch event 时通过webView:shouldStartLoadWithRequest:navigationType 通知我。我能够从 touches 事件中恢复目标对象,但我不确定从那里开始。
我注入的内容:
[webView stringByEvaluatingJavaScriptFromString:
@"function MyFunction(e){document.location='http://null/'+e.touches[0].target;}
window.ontouchstart=function(e){MyFunction(e)}"
];
【问题讨论】:
标签: javascript iphone ios objective-c uiwebview