javascript - sending multiple ajax requests not getting expected repsonse -


so have javascript function submits individual submissions form phpfile (processfeedback.php) adds each submission array. once array filled array passed ajax callback (i think that's proper terminology). if array passed array gets passed php file (insertfeedback.php) insert data database accordingly.

the entire site , scripts work perfectly, in array getting filled , passed ajax call correctly. i'm getting error message on (insertfeedback.php) file call. of right insertfeedback.php file nothing insert database connect file. there no return or being done on page. have tried several options, setting various arrays , json_encoding them same response every time. can't set answer why jqxhr.error sends me jquery fuction not of yet understand, , there no jqxhr.responsetext (both of use regularly debugging.

here's function:

function preparedata(cont, sect) {      var sentdata = {'choice': cont, 'section': sect};     var addsession = $.post('processfeedback.php', sentdata, null, 'json');     addsession.done(function (fbdata) {         console.log('success:  ' + fbdata);         action = fbdata.action;          if (fbdata.status) {             receiveddata = fbdata.data;             console.log('receiveddata.age:  ' + receiveddata.age);             var insertdata = $.post('insertfeedback.php', receiveddata);             insertdata.done(function(insertdata) {                 console.log('from insert page:  ' + insertdata);             });             insertdata.fail(function(noinsertdata) {                 console.log('failed @ insert page:  ' + noinsertdata);             })         }          if (!fbdata.status) {             console.log('form not complete yet');         }          eval(action);     });     addsession.fail(function (a, b, c) {         console.log('failure: ' + a.reponsetext);     }); }    

i have been starting @ code hours, know going painstakingly simple answer. messing variables somewhere along way. why insertdata function keeps failing.


Comments