1

I've already tried a number of threads but so far I can't get it to work.

I got the rows clickable to a new URL but it opens in the same tab, this worked. However, I want the URL to open in a new tab. I tried this and this but no luck.

I even tried to modify the first option from window.location to window.open but it is not responding.

jQuery(document).ready(function($) {
    $(".click-row").click(function() {
        window.open($(this).data("href"));
    });
});
    <table> 
       <tbody>
          <tr class='click-row' data-href="/Documents/files/file.pdf"> 
             <td>Link to file</td> 
          </tr> 
      </tbody> 
    </table>
matthias_h
  • 11,356
  • 9
  • 22
  • 40
Michiel
  • 39
  • 4

1 Answers1

1

Always use target="_blank" for open URL in New Tab

<table> 
       <tbody>
          <tr class='click-row' data-href="/Documents/files/file.pdf" target="_blank"> 
             <td>Link to file</td> 
          </tr> 
      </tbody> 
    </table>