var array_info = {}; array_info['key1'] = $("#field1").val(); array_info['key2'] = $("#field2").val(); var array_info_json = JSON.stringify(array_info); //ajax call $.ajax({ url: "file.php", type: "POST", data: { action: "parameter", field_data: array_info_json }, success: function (data) { console.log(data); if (data != '') { $('#div_container').html('Sucess'); dataArray = JSON.parse(data); } else{ alert('No data'); } }, error: function (a,b) { alert('Error'); } });
Tips about programming, tips about software and web development in general and links to cool/useful tech sites
2014-08-05
Skeleton AJAX call with JQuery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment