Skip to content

Tag: ajax

XMLHttpRequest not sending token (Laravel page expired)

I’m using Laravel and trying to send a form via XMLHttpRequest. It works but the request in the controller doesn’t identify it as ajax. The form has a csrf input. I’ve tried several things, right now my code looks like: But Laravel keeps sending a 419 | Page Expired response. Maybe I’m misinterpreting this information, barking at the wrong tree,

How to remove woocommerce spinner on pages?

I know you can disable the preloader/spinner on WooCommerce checkout page using the following CSS code: However, the WooCommerce preloader / spinner still appears on all other related pages for example the Shop and Single Product Page. I have read Woocommerce Uses jQuery BlockUI Plugin to make a blocking overlay with an animate spinner on some jQuery events and on

AJAX POST submit to PHP – empty POST on arrival at PHP?

I am submitting a POST request via AJAX to my PHP script. The browser tools Network tab shows the POST data has values, on arrival at my PHP script the $_POST value is true, isset() verification is valid, and there should be no problem to assign the $_POST[‘input’] values to my $variables. Yet, my debug bar tells me that the

How To Target A Specific PHP Function Using Ajax

I am creating a simple comment program. i want to use ajax to refresh the comments and total number of comments. Keeping both functions in a single file is not working for me. here is my code: HTML: PHP: include.php AJAX: Answer Set the PHP to process a named POST item and use switch to determine which function to use:

Setting ajax url in external js file in laravel 8

i have a single paged website developed in laravel 8 uploaded on a live server. The site has a contact form which uses ajax to send mail. Am currently having issues with setting the right ajax url. I have checked some solutions online but none have solved the problem. Below are my routes. On the blade header i have this:

How to save current state of html body php

I have a html website with Sortable.js. I want to save the current state of the body when a user rearranges the list and clicks a save button. I don’t want it to save to local storage but directly to the hosted file, replacing the body html with the new rearranged version. I believe what I’m trying to achieve is