0
The following code will display several "tumbnails", where each has a button designated "tracklist". But it happens, for example, if I click one of the buttons and do not close the window, all other "tracklist" buttons that are "clicked" or activated will "write" in the first open window...
<head>
<script type="text/javascript">
function myFunction(content) {
var playlist = content;
var x = parseInt((screen.width-800)/2);
var y = parseInt((screen.height-600)/2);
var win = window.open( '', 'pop', 'scrollbars=1,statusbar=1,menubar=0,resizable=1,width=800,height=600' );
win.document.write ('Playlist:' + playlist);
win.moveTo(x,y);
}
</script>
</head>
PHP
foreach($rows as $row){
echo "<div class='tumbnail'>";
echo "<img src='imagem.jpg'>";
echo "<input class=\"btn_tracklist\" type=\"button\" value=\"Tracklist\" onclick=\"javascript:myFunction('" . $row['tracklist'] . "')\"> </br>";
echo "</div>";
} /*END Foreach*/