I have a table composed of 3 columns: link, status, action.
In the action column, I have 2 links that will serve as "buttons": VIEW & TO DISCARD
Thistablehasinaverage+100lines...
IneedtheuserclickonVIEW,togetthevalueofthecolumn"Link" in the respective line ... so that a link is created where a redirect to a page will occur in a new tab.
Logical example:
String value = takes the value of the link column in the respective row
String link=" link " + value
What I've done:
I'm using the following function
<script type="text/javascript">
$(document).ready(function() {
$('#mytable td').click(function() {
posicao = $(this).parent().children().index(this);
link = $('td:first', $(this).parents('tr')).text();
$(this).attr('title', link);
window.open("http://www.webmotors.com.br"+link);
});
});
</script>
This function takes the value of the link column when I click on the row (tr) of the table ... I wanted to get the value only when I clicked SEE, but I could not do it this way, if someone knows a way to do this I'll be grateful.
The problem:
When you run the window.open (site)
The page that generates in a new tab comes with a "% 20" between the site and the link that I have in the table value ...
This%20preventsopeningthepage...ifItakeitinhandthepageopens...Idonotunderstandwhyheshowsupinthemiddle...Ineedtogethimout.
Thepartthatmountsthelinkis:
window.open("http://www.webmotors.com.br"+link);
I need help with this.