javascript - Ajax Call Syntax -


Trying to post a simple Ajax for some reason, this is not posting my data! This file successfully posts (ajaxpost.php), but no post data is passed.

  var myKeyVals = {caption: "test"}; Process the form using $ .exe ({// $ .ajax () type: 'POST', // method type URL: 'ajaxpost.php', // Your form processing file URL data: myKeyVals, / / Form name data type: 'Json', success: work (data) {if (! Data.success) {// fails (data.errors.name) {// process.php $ ('.throw_error '). FadeIn (1000) .html (data.errors.name); // throwing the relevant error}} and {$ (' # breakthrough '). FadeIn (1000) .append (' & lt; P & gt; '+ data.posted +' & lt; / p & gt; '); // if successful, throwing a successful message}}});  

This is my AjaxPost.php ..

   $ _ GET ['caption'. ]  but you should use the  $ _ POST ['caption']  because it is a post request. 


Comments