Ecommerce Shopify WordPress Discussion

Ajax returning 500 error on form data submit [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed yesterday. Improve this question I had a 3rd party developer write some ajax while ago that submits form data on my wordpress site, however I'm now getting a 500 server error on this admin-ajax.php call. Other uses of admin-ajax.php throughout the site are working fine. Is there something syntactically wrong with the below code? Potentially old, non-supported practice being used? I'm trying to pinpoint where to focus.. Is there a way to verify if the 500 error is being returned from the below code, or is it potentially being returned from the 'ruo_team_invite' action used in the ajax data? Any guidance is appreciated. <script> jQuery(document).ready(function($){ $(".team_invite_form input:submit").click(function(e){ e.preventDefault(); var form = $(this).closest('form'); var formData = form.serialize(); $("#invite-ajax-message").html( "Loading..." ); var ajax_url = "<?php echo admin_url( 'admin-ajax.php' ); ?>"; var subaction = e.target.value; $.ajax({ type: "POST", url: ajax_url, data: formData + "&action=ruo_team_invite&subaction=" + subaction, success: function(data){ var message = "Please choose or create a player"; if(data == "accept" || data == "decline") { message = "Saving..."; //form.hide(); //location.reload(); if(data == "accept") { var teamid = form.find("[name='teamid']")[0].value; var playerid = form.find("[name='playerid']")[0].value; /* var url = window.location.protocol + "//" + window.location.hostname + "/edit-superfans/?action=editteam&playerid=" + playerid + "&team=" + teamid;*/ var url = window.location.protocol + "//" + window.location.hostname + "/player-dashboard/edit-profile?playerid=" + playerid + "&team=" + teamid + "&action=edit";; window.location.href = url; } else { var url = new URL(window.location.href); url.searchParams.set('action',data); window.location.href = url.href; } } else { message = data; } $("#invite-ajax-message").html( message ); }, error: function(xhr, status, error){ console.error(xhr); } }); }); }); </script>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.