title: Reload window with new url on click
body: <p>I have made a anchro tag with 2 urls. One is href and other is data-url. When i click on button it should open a page in new tab which is correct. But additionally what i want is to reload the current page with the data-url link that i set. </p>
  
  <p>So in the example i set href to google.com and it opens in new tab. Its correct but when we click the button i additionally the the current page to reload to data-url that is youtube.com.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;a href="https://www.google.com/" target="_blank" data-url="https://www.youtube.com/" id="agree"&gt;Click me&lt;/a&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code> $('#agree').on('click', function(e) {
    var url = $(this).data('url');
    console.log(url);
    // window.open(url);
    location.reload(url);
  });
  </code></pre>
  
  <p><a href="http://codepen.io/sabipu/pen/AXwjEO?editors=1010" rel="nofollow">Link To Codepen</a></p>