Enfin ! Problème résolu !
J'ai modifié ma fonction go()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| function go(ID){
//var ID = document.getElementById('idimage').value;
$.ajax({
url: "requetesql.php",
data: "ID="+ID,
type:'GET',
DataType:'html',
ifModified:true,
success: function(content) {
$('#fond').html(content);
alert(content);
var img = document.createElement("IMG");
img.src = 'files/'+content;
document.getElementById('fond').appendChild(img);
}
}); |
Je lui ai attribué une valeur qui correspond à :
echo '<div class="scroll-content-item"><img src="files/'.$row["Img"].'" width="100%" onclick="go('.$row["ID"].');" ></div>';
Merci beaucoup !
Partager