Category : ajax

I’m using ajax request to submit registration form. If a user submit form on first attempt with correct information, the request is working well. But If user made any mistake, correct the information and submit again, the data is inserted but in console.log(data), I’m facing this error: "CSRF token mismatch." "vendorlaravelframeworksrcIlluminateFoundationExceptionsHandler.php". Line: 389. head.blade.php <meta ..

Read more

When you append, the data in index.php comes as well. idont want this. I just want the data on the page I appended to come. How i can? $(document).ready(function() { $(document).on("click", ".show_more", function(){ var id = $(this).attr("id"); $(".show_more").hide(); $(".loading").show(); $.ajax({ url: "ajax.php", data: {id:id}, type: "post", success:function(e){ $("#altmenu_" + id).remove(); $(".genel").append(e); } }); }); }); ..

Read more

The following is my PDO code for ajax : (but it’s not working properly on Profreehost free domain) <?php include "config.php"; $request = 0; if(isset($_POST[‘request’])) { $request = $_POST[‘request’]; } if($request == 1) { $countryid = $_POST[‘countryid’]; $stmt = $conn->prepare("SELECT * FROM product_main WHERE category=:country ORDER BY subcategory"); $stmt->bindValue(‘:country’, $countryid); $stmt->execute(); $statesList = $stmt->fetchAll(); $response ..

Read more

So I have a website that has three forms for adding data into my database and everytime I submit a form the page refreshes, I heard that I should use AJAX to do it without the page refreshing it self. Could anybody point me what should I use? Sourc..

Read more

If the browser has loaded the document and all external resources, you can load and fire via button/click based on xmlhttprequest() more JavaScript files and HTML documents with integrated JavaScript files? index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type="text/javascript" src="rq.js"></script> </head> <body></body> </html> rq.js function put() { const xhrURL = ‘load.php’; const xhr = ..

Read more