getobj.php代码<?php
header('Content-Type: image/jpg');readfile($file);
?>调用页面main.php<img src='getobj.php?file=xx1.jpg' />
<img src='getobj.php?file=xx2.jpg' />如果我多次调用main.php,并且里面有很多这样显示的图片的话,第二个main.php必须等第一个main.php的图片显示完了才会开始显示.
请问是为什么啊,有没有什么办法让他们都能一起显示.
var xmlhttp;
function loadXMLDoc(picName){
if (window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}
if (window.ActiveXObject){
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp==null){
alert ("Your browser does not support XMLHTTP!");
return;
}
xmlhttp.onreadystatechange=displayPicture;
xmlhttp.open("GET",'getobj.php?file=' + picName,true);
xmlhttp.send(null);
}function displayPicture(){
if (xmlhttp.readyState==4){
if (xmlhttp.status==200){
var img = document.getElementById('img1');
img.src = xmlhttp.responseText;
}else{
alert("Problem retrieving XML data:" + xmlhttp.statusText);
}
}
}
</script>
我的服务器可能不支持ajax,还有没有别的办法?