Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

点击_blank链接不跳转 #94

Open
KangYJie opened this issue Dec 6, 2018 · 0 comments
Open

点击_blank链接不跳转 #94

KangYJie opened this issue Dec 6, 2018 · 0 comments

Comments

@KangYJie
Copy link

KangYJie commented Dec 6, 2018

链接http://guan.ule.com/guan/jiangsu/tag/gonghuie.html
simulator screen shot - iphone x - 2018-12-06 at 16 12 06

替换,才可以加载

// if (!navigationAction.targetFrame.isMainFrame) {
// [webView evaluateJavaScript:@"var a = document.getElementsByTagName('a');for(var i=0;i<a.length;i++){a[i].setAttribute('target','');}" completionHandler:nil];
// }
//如果是跳转一个新页面
if (navigationAction.targetFrame == nil) {
[webView loadRequest:navigationAction.request];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant