How to Delete Data in Laravel using AJAX without Refreshing the Page

Поделиться
HTML-код
  • Опубликовано: 19 май 2023
  • #deletedatainlaravelusingajax
    Laravel Simple Blog Website Project Tutorial For Beginners to Advance Playlist Link : • Laravel Simple Blog We...
    Buy me a Coffee 🥰 : www.buymeacoffee.com/yaminshakil
    Support This Channel :
    Join this channel to get access to perks:
    / @webtechknowledge
    Your support will be really appreciated.
    Thanks For Watching.
    I hope This video was helpful. If you have any questions then let me know in the comment section.
    Best of luck
    #webtechknowledge
    You can connect with me with the given links below:
    Facebook Link: / yaminshakil07
    Instagram Link: / yamin_shakil
    Twitter Link: / yaheashakil

Комментарии • 6

  • @WebTechKnowledge
    @WebTechKnowledge  Год назад

    function deletepost(id)
    {
    if(confirm("Are you sure to delete this"))
    {
    $.ajaxSetup({
    headers:
    {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
    });
    $.ajax({
    url:'delete_post/'+id,
    type:'DELETE',
    success:function(result)
    {
    $("#"+result['tr']).slideUp("slow");
    }
    });
    }
    }

  • @kanthareddy3409
    @kanthareddy3409 9 месяцев назад

    Hi ...brother
    You're the best one. To explain the concepts of laravel, please make more videos if possible to you. Thank you.

  • @ETcodenet
    @ETcodenet 9 месяцев назад

    what an excellent explanation thanks a lot🙏🙏🙏

  • @potaetoupotautoe7939
    @potaetoupotautoe7939 Год назад

    Nice video

  • @nandopookey9195
    @nandopookey9195 Год назад

    Thank you sir

  • @ibrownlad
    @ibrownlad 11 месяцев назад

    function deletepost(id)
    {
    if(confirm("Are you sure to delete this"))
    {
    $.ajaxSetup({
    headers:
    {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
    });
    $.ajax({
    url:'delete_post/'+id,
    type:'DELETE',
    success:function(result)
    {
    $("#"+result['tr']).remove()
    }
    });
    }
    }
    Hey Sir u defined so well but the preferred way is to remove the element instead of hiding it, use remove method instead of slideup, Jazaka Allah