试试这个:
在复选框单击处理程序中:
$.ajax({
type : 'post',
url : 'test.php?id=52454',
dataType : 'json',
success : function (obj) {
//construct and create the element
var content = $('<div id="' + obj.ajaxSRC1 + '" class="CLASS">'
+ '<a href="#">'
+ '<img src="'+obj.ajaxSRC2+'" width="'+obj.ajaxSRC3+'" height="'+obj.ajaxSRC4+'" alt="..." />'
+ '</a></div>');
// bind mouseover event to the anchor tag
content.find('a').mouseover(function() {
myFunction(obj.ajaxSRC5, obj.ajaxSRC6);
return false; // alternative to href="javascript:void(0)"
});
// append the newly created div to DOM
divContainer.append(content);
}
});