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 app to opens specific link in Safari browser not inside the UIWebView.
Is that doable without writing any iOS code and instead of that make the JavaScript opens that link in Safari itself ?
I have thatcode,but it doesn't help at all:
HTML Code
<tr class='link-to-pdf' data-href='www.example.com'>
JS Code:
$(".link-to-pdf").click(function () {
var a = document.createElement('a');
a.setAttribute("href", this.getAttribute("data-href"));
a.setAttribute("target", "_blank");
var dispatch = document.createEvent("HTMLEvents");
dispatch.initEvent("click", true, true);
a.dispatchEvent(dispatch);
});