Android : Can I open webview link in browser without change java code?

on Wednesday, October 29, 2014


In my webview app, some external url will open in same webview, I want these link open in default browser.


I know I can use shouldOverrideUrlLoading to solve this problem, but I don't want change java code because some reason.


Is it possible solve this in HTML or Javascript?


Some people said, I can use this



$(document).on('click', 'a[target="_blank"]', function(ev) {
var url;
ev.preventDefault();
url = $(this).attr('href');
window.open(url, '_system');
});


But I tried, it does not work.


0 comments:

Post a Comment