I'm trying to adapt a code that should do the following by clicking on a cell in a table to trigger the link by opening the file in a new browser window, what I have so far is in the tr
table a data-url
that calls a function.
The code works but does not open in a new window
Table with the function call:
<tr data-url="<?php echo $DadosFichas->Url; ?>">
<td><?php echo $DadosFichas->Nome; ?></td>
</tr>
Call function:
$(document).ready(function(){ $('table tr').click(function(){ window.location = $(this).data('url'), target = "_blank" ; return false; }); });