我能够看到表格结果但是在图片中columm没有显示图片,但是如果我直接加载ajax_search_r.php或者ajax_search_r.php我就能看到图像。尝试渲染DATA返回时发生了什么,是我试图加载的相同的回声代码,云有人帮帮我吗?
我有调用内部的Jquery clik事件
这是Main.PHP页面,里面调用了这个
<body>
<div id="search"></div>
...
$.post("../ajax/ajax_search_r.php",{criteria:criteria,value:value},function(data){
$('#search').html(data);
...
这是我的ajax_search_r.php
...
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['0'] . "</td>";
echo "<td>" . $row['1'] . "</td>";
echo "<td>" . $row['2'] . "</td>";
echo "<td>" . $row['3'] . "</td>";
echo "<td>" . $row['4'] . "</td>";
echo "<td>" . $row['5'] . "</td>";
echo "<td>" . $row['6'] . "</td>";
echo "<td><img src=ajax_image.php?id=".$row['0']." width=160 height=120/></td>";
echo "</tr>";
}
echo "</table>";
...
和ajax_image.php
...
if($result)
{
$picture = mysqli_fetch_array($result);
header('Content-Type: image/jpg');
echo $picture['11'];
}else
echo "problem";
...
答案 0 :(得分:1)
似乎他们在src网址周围没有引号
echo "<td><img src=ajax_image.php?id=".$row['0']." width=160 height=120/></td>";
echo "<td><img src\"=ajax_image.php?id=".$row['0']."\" width=160 height=120/></td>";
或'和'的组合