Need JavaScript var in anchor
Posted
by
Helto
on Stack Overflow
See other posts from Stack Overflow
or by Helto
Published on 2012-09-25T15:30:38Z
Indexed on
2012/09/25
15:37 UTC
Read the original article
Hit count: 153
JavaScript
|html
I'm sure this is really simple, but I need some help.
I'm trying to insert a variable into an anchor in the following snippet
var tablerows = ''
$.each( data, function(index,row){
id = row.shift()
tablerows += '<tr><td><a href="getuserimage.php?id=" target="_blank">' + row.shift() + '</a></td>'
tablerows += '<td>' + row.join('</td><td>') + '</td></tr>'
})
$("#users-table > tbody").html(tablerows)
I'm just not sure how to get the id in there
© Stack Overflow or respective owner