1
I’m trying to adapt a code that should do the following, by clicking a cell of a table trigger the link by opening the file in a new browser window, what I have so far is this, on tr of table one data-url calling a function.
Code works, but does not open in a new window
Table with function call:
<tr data-url="<?php echo $DadosFichas->Url; ?>">
  <td><?php echo $DadosFichas->Nome; ?></td>
</tr>
Function called:
$(document).ready(function(){
    $('table tr').click(function(){
        window.location = $(this).data('url'), target = "_blank" ;
        return false;
    });
});
						
Why not use the element itself
aHTML with the attributetarget="_blank"?– Woss
what happens? opens in the same tab? does not open?
– RFL
Hm tested: window.open(url, '_Blank'); but also wanted to know the same as @Andersoncarloswoss
– Aline
Hi, @Andersoncarloswoss and Rafael Acioly, thanks for asking, responding to Anderson, I need to make available the option to click on the whole cell and Rafael, the page opens but in the same tab.
– adventistapr