js 文件里面显示的
$.getJSON("htllo?t=" + new Date().valueOf(), {
"action":"userId",
"id":tmp
},function(data){
$("#hh").html(data.image);---这个地方是不是写错了呢?
});
-----------------------------------------------------
jsp 页面显示的<img id="" src="">--怎么把图片显示出来呢???????????????????????<input type="text" id="hh"> ---是可以把数据库里面的获取到图片的路径的
大家帮帮忙
$.getJSON("htllo?t=" + new Date().valueOf(), {
"action":"userId",
"id":tmp
},function(data){
$("#hh").html(data.image);---这个地方是不是写错了呢?
});
-----------------------------------------------------
jsp 页面显示的<img id="" src="">--怎么把图片显示出来呢???????????????????????<input type="text" id="hh"> ---是可以把数据库里面的获取到图片的路径的
大家帮帮忙
------------------------------------------------
js alert(data) 是对象
$.getJSON("htllo?t=" + new Date().valueOf(), {
"action":"userId",
"id":tmp
},function(data){$("<img width='60' height='60'/>").attr("src", data.image).appendTo("#image");});
----------------------------------------------------------jsp 写的
<div id="image"/>
图片是显示出来了,但是在jsp 页面点击的时候就会点击出很多重复的图片,怎么处理的?
要么就限制这个AJAX事件的出发次数,要么把插入图片的那段JS这么写
$("#image").html('<img width="60" height="60" src="'+data.image+'">');