Here I need a help how to write @if role in the javascript if Im using Laravel and the code in laravel as you see but I want to write the same code in the ajax section
Laravel code:
<td class="text-center">@if ($post->adver_position==0) TOP @endif @if ($post->adver_position==1) RIGHT @endif @if ($post->adver_position==2) LEFT @endif @if ($post->adver_position==3) BOTTOM @endif</td>
Ajax:
$('.item' + data.id).replaceWith("<tr class='item" + data.id + "'><td class='col1'>" + data.id + "</td><td><img src='images/" + data.adver_photo + "'style='width: 50%;margin-left: 35px;border-radius: 3px;border: 1px solid #1a2732;' /></td><td>" + data.adver_title + "</td>"