私はこのjsコードを持っています:
$.ajax({
type: 'POST',
url: url,
data: {id: id, 'YII_CSRF_TOKEN': token },
success: function(data) {
var content = $(data).find('.content');
console.log(content);
$('.content').html(content);
}
}).error(function() {
console.log('Error!');
})
console.log() のデータ:
[prevObject: jQuery.fn.jQuery.init[27], context: undefined, selector: ".content", constructor: function, init: function…]
コンテンツが挿入されません。私が試してみると:
$('.content').html('TEST');
それは機能します。jQueryオブジェクトの問題だと思います。