Я пытался перезагрузить часть страницы после того, как пользователь создал сообщение.
JavaScript
success: function(result)
{
$("#postsxd").load(" #postsxd");
console.log(result);
}
Blade
@foreach(Auth::user()->posts()->latest()->paginate(1) as $userpost)
<div class="ui-block" id="postsxd">
<article class="hentry post">
<div class="post__author author vcard inline-items">
<img src="{{ $userpost->user->getFirstMediaUrl('pps') ? $userpost->user->getFirstMediaUrl('pps') : '/img/ava_10.jpg' }}"
width="36" height="36" alt="author">
<div class="author-date">
<a class="h6 post__author-name fn" href="#">{{ $userpost->author }}</a>
<label style="font-size: 12px;">(Your latest post)</label>
<div class="post__date">
<time class="published" datetime="2004-07-24T18:18">9 hours ago</time>
</div>
</div>
</div>
<p>{!! $userpost->content !!}</p>
</article>
</div>
@endforeach
Я не знаю, почему страница не перезагружает этот элемент или что я делаю неправильно.Заранее благодарим за помощь.
Кроме того, как я могу изменить кнопку после того, как пользователь отправит форму или щелкнет по ней?