function getImgs() {
var result = '';
$.ajax({
url: "http://localhost/joinUs.html",
async: false,//改为同步方式
type: "GET",
data: {},
success: function (data) {
result = $(data).filter('#content').find('.img-item');
}
});
return result;
}
关键就是: result = $(html_string).filter('#content').find('.image-item'); // html_string 即html字符串
1、$(html_string), 这样就能应用selector了
2、filter()
3、find()
直接find好像不行,不懂为啥