ajax
Código:
javascriptfunction getImage2() { idimg = img+"2"; if (req.readyState == 4) { if (req.status == 200) { // Extract "true" or "false" from the returned data from the server. var message = req.responseText; // alert(message); // var imagen= message.getElementsByTagName('src').item(0).firstChild.data; document.getElementById(idimg).style.width = "150px"; document.getElementById(idimg).style.height="150px";// height: document.getElementById(idimg).style.visibility="visible"; document.getElementById(img+"2").style.bgcolor="#FFFFFF"; //alert(imagen); document.getElementById(idimg).innerHTML=message+"<p align=\"center\"><b>"+img+"</b></p>"; document.getElementById(idimg).style.position="absolute"; } } }
Código:
document.getElementById(idimg).innerHTML="<img src=\"pathimagen\"><p align=\"center\"><b>"+img+"</b></p>";