我可以访问magnificPopup中包含的跨度的当前.html()值。但是我不能设置这个值。这就是我的意思:
parseAjax: function(mfpResponse) {
// This works perfectly
var mycontent = $(mfpResponse.data).find('#textreported').html();
// But this does not work
$(mfpResponse.data).find('#textreported').html('Text to be assigned');
}有人知道我做错了什么吗?提前谢谢。
发布于 2017-07-21 04:21:11
我会自己回答的。这是正确的方法:
parseAjax: function (mfpResponse) {
str = jQuery.parseHTML(mfpResponse.data)
$(str).find('#textreported').html('Text to be assigned');
mfpResponse.data = $(str)
}它可能对某些人有用。
https://stackoverflow.com/questions/45209136
复制相似问题