После изменения HTML-содержимого (содержащего теги с их классом) элемента div невозможно выбрать новые элементы по их классу в jQuery.Эта функция изменяет HTML-содержимое div'ов:
function getPostdetail(idofpost) {
$.ajax({
url: 'offer_inf.php',
type: 'POST',
data: 'postid=' + idofpost,
dataType: 'json',
success: function(information) {
$('.band').html('<h1>' + information.titre + ' | ' + '<span style="color:#edcb21;">' + information.prix + '</span></h1>');
$('.table-1-row-1').html(information.image);
$('.table-1-row-2').html(information.imagelist);
$('.table-1-row-3').html(information.detail);
$('.post-comment-title').css({ 'visibility': 'visible' });
console.log($('.post-view').text());
}
});
}
getPostdetail(ident);
information.detail
являются примерами содержимого:
<p>
<i class="material-icons">content_paste</i><br>
<span class="post-date"># 12 AOU 2018</span>
<span>et vue <span class="post-view">1000</span> fois</span><br><br>
Une belle maison, avec peinture verte. piscine et jardin. meublé avec décoration. chateau d'eau incluse, carreaux et marbre dans la pièce. toute ce qu'il faut pour vos reves. electricite avec panneau solaire et bien d'autres.<br>
</p>
Моя проблема в том, когда я делаю console.log ($ ('.post-view'). Text ());
в $ .ajax successобратный звонок я ничего не получаю.Пожалуйста, помогите мне