skip to Main Content

looping a javascript object inside a loop of custom object – Jquery ajax

First of all I'm beginner in javascript. I have this data data.responseJSOn.errors - Currently I'm displaying the errors like this way - var errors = data.responseJSON.errors; console.log(errors); errors.title && errors.title.forEach(function(messageText) { displayError(messageText); }); errors.message && errors.message.forEach(function(messageText) { displayError(messageText); }); How…

VIEW QUESTION

Why does a FormData object work but not a regular object in Jquery AJAX submit?

I am confused about using data objects in my AJAX submit. Here's my submit AJAX script: $.ajax({ url:'/library/php/triggers.php', type:'POST', data:data, cache:false, dataType:'json', processData:false, contentType:false, success:function(result){console.log(result);} }); This data works: var data=new FormData(this); data.append('hello','my friend'); But this data does not work:…

VIEW QUESTION
Back To Top
Search