0
亲爱的所有IM通过这个代码,提示以下输出锻炼对JSON输出
["images\/zara\/shoes\/thumbnail\/1.png","images\/zara\/shoes\/thumbnail\/2.png"]
$imgurl=array();
$i=0;
if(mysql_num_rows($result) > 0){
//Fetch rows
while($row = mysql_fetch_array($result)){
$imgurl[$i]=$row['imgurl'];
//echo "<img src='$imgurl[$i]' />";
$i+=1;
}
}
echo json_encode($imgurl);
和现在的jQuery结束IM抓住这个代码,并获得显示,但我想经营一个循环在输出上创建新的img标签并在新的img src中插入每个图像路径“”
$(document).ready(function() {
$('ul.sub_menu a').click(function() {
var txt = $(this).text();
$.ajax({
type: 'POST',
url: 'thegamer.php',
data: {send_txt: txt},
datatype:'json',
success: function(data){
$('#main-content').html(data);
}
});
});
});
将使用任何代码全
其不工作 – sajid 2012-01-14 07:40:15
数据在你的成功函数中的价值是什么? – craigmj 2012-01-14 07:44:08
在我的问题的顶部plz看它 – sajid 2012-01-14 07:46:00