I have an iOS app which has only one view and that is UIWebView (It opens the main content of the app). I would like when I make a click somewhere(e.g on a table row) the a
In some cases, you can tell all links in your javascript that have target="_blank"
, and pass them to window.open with the '_system' param. This will work on both iOS and Android.
$(document).on('click', 'a[target="_blank"]', function(ev) {
var url;
ev.preventDefault();
url = $(this).attr('href');
window.open(url, '_system');
});
Or in your case, simply replace a.setAttribute("target", "_blank");
with a.setAttribute("target", "_system");
This worked for me in an ancient projekt, but im unsure if it still works (on iOS and Android)