title: iOS UIWebView app opens link in Safari
body: <p>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. </p>
  
  <p>Is that doable without writing any iOS code and instead of that make the JavaScript opens that link in Safari itself ?    </p>
  
  <p>I have thatcode,but it doesn't help at all:</p>
  
  <p><strong>HTML Code</strong></p>
  
  <pre><code>&lt;tr class='link-to-pdf' data-href='www.example.com'&gt;
  </code></pre>
  
  <p><strong>JS Code:</strong></p>
  
  <pre><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);
  
          });
  </code></pre>