Home › Forums › Quform WordPress › ajax problem
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by oivanr.
- AuthorPosts
- November 11, 2022 at 4:01 pm #34913oivanrParticipant
Hi,
I have developed a wordpress site in my localhost, there everything works fine. Now I take it to my production site tnere I have this message: POST https://xxxxx.com/wp-admin/admin-ajax.php 400.
Also give me this error: /wp-admin/admin-ajax.php:1 Failed to load resource: the server responded with a status of 400 ()
The ajax-var is: {url: ‘https://xxxxxx.com/wp-admin/admin-ajax.php’}I disabled all the plugins except my plugin and quforms and has no effect.
I written to my host provider and the say everything is fine. I even change my PHP version and nothing differente happen.
I am including a print screen of the error in console.
No error in php error log neither wp_debug.
At console I print the error when execute the ajax:
1 abort:ƒ(e)
2 always:ƒ()
3 catch:ƒ (e)
4 complete:ƒ()
5 done: ƒ ()
6 error:ƒ ()
7 fail: ƒ ()
8 getAllResponseHeaders: ƒ ()
9 getResponseHeader:ƒ (e)
10 overrideMimeType: ƒ (e)
11 pipe: ƒ ()
12 progress:ƒ ()
13 promise: ƒ (e)
14 readyState: 4
15 responseText: “0”
16 setRequestHeader: ƒ (e,t)
17 state: ƒ ()
18 status:400
19 statusCode:ƒ (e)
20 statusText:”error”
21 success: ƒ ()
22 then:ƒ (t,n,r)
23 [[Prototype]]: ObjectWhat I am doing is: when the field (1 – see the attach file) change value (is a dropdown), I invoke a function (line 30)
24 jQuery(function ($) {
25 // cambios en los campos dropdown de los formularios
26 $(‘.quform-field-1_10’).change(function () {
27 codCuenta = $(‘.quform-field-1_10’).val();
28 $(‘.quform-field-1_3’).val(codCuenta);
29 $(‘.quform-field-1_4’).val($(‘.quform-field-1_10 option:selected’).text());
30 consultaFlds(‘wp_vw_001_002′,codCuenta,’cb_001_codCuenta’,”,”);
31 })The function make an ajax call (line 243 this is line of the php program, the others are just reference numbers):
238 function consultaFlds(tabla,queBuscar,dondeBuscar,queBuscar2, dondeBuscar2){
239 var accion = ‘busquedaFlds_Ajax’;
240 console.log(tabla);
241 console.log(queBuscar);
242 console.log(dondeBuscar);
243 jQuery.ajax({
244 type : ‘POST’,
245 url : ajax_var.url,
246 datatype : ‘json’,
247 data: {
248 action : accion,
249 tabla : tabla,
250 dondeBuscar : dondeBuscar,
251 queBuscar : queBuscar,
252 dondeBuscar2 : dondeBuscar2,
253 queBuscar2 : queBuscar2
254 },The console log, as you can see send the call to ajax (line 35 – line 243 php code line).
Then go to ajax and execute the line 2 of php-ajax-admin (line 32)
32 send @ jquery.min.js?ver=3.6.1:2
33 ajax @ jquery.min.js?ver=3.6.1:2
34 s.ajax.s.ajax @ jquery-migrate.min.js?ver=3.3.2:2
35 consultaFlds @ chatBotLib.js?ver=6.1:243
36 (anónimo) @ chatBotLib.js?ver=6.1:7
37 dispatch @ jquery.min.js?ver=3.6.1:2
38 y.handle @ jquery.min.js?ver=3.6.1:2
39 handleMouseUp_ @ desconocidaAnd send me this error (what I included earlier):
<b>POST https://xxxx..com/wp-admin/admin-ajax.php 400.</b>Thanks in advance for your help.
- This topic was modified 2 years ago by oivanr. Reason: include host address
- This topic was modified 2 years ago by oivanr. Reason: More information
Attachments:
You must be logged in to view attached files.November 15, 2022 at 9:00 am #34922AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
November 16, 2022 at 6:45 pm #34937oivanrParticipantThanks.
It works fine. The issue was the name of my ajax handler. - AuthorPosts
- You must be logged in to reply to this topic.