Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
estou com problemas em um visualizador de imagens que estou montando em ajax....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">var xmlhttp = null;
function Imagem() {
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined' ) {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
document.getElementById("Img").innerHTML= "<div align='center'><img src='loading.gif' align='absmiddle'><span class='normal'></span><BR><BR></div>";
if (xmlhttp) {
xmlhttp.onreadystatechange = imagem;
img = document.getElementById("img").src;
xmlhttp.open("GET","imagens.php?img="+img);
xmlhttp.setRequestHeader('Content-Type','text/xml');
xmlhttp.setRequestHeader('encoding','ISO-8859-1');
xmlhttp.send(null);
}
}
function imagem() {
if ( xmlhttp.readyState == 4) {
if ( xmlhttp.status == 200) { // resposta do servidor OK
document.getElementById("Img").innerHTML = xmlhttp.responseText;
} else {
alert( "Problema: " + xmlhttp.statusText );
}
}
}</script>
</head>
<body>
<table>
<tr>
<td><img src="imagens/trilogy-1280x800.jpg" height="50" width="50" id="img" name="img" border="1" onclick="Imagem()"></td>
<td><div id="Img"></div></td>
</tr>
</body>Imagens.php
<img src="<? echo $_GET["img"]?>" height="400" width="400">até aqui ele funciona porque tem uma só imagem quando eu coloco a segunda imagem ou dá erro ou a segunda imagem domina a primeira fazendo com que a segunda tome o espaço das duas
tem como eu fazer com que as duas ou mais imagens nao entre em conflito???
Carregando comentários...