$(function(){ // $Date is perl of course var json=jQuery.parseJSON(\'{"DATE":"'.$Date.'"}\'); json["address"]="123 some street"; // other functions generate more fields. and call postM() postM(); function postM(){ $.ajax({ url: "params.pl", type: "GET", processData: false, data: JSON.stringify(json), dataType: "text", async: true, success: function(msg){ alert("perl says: "+msg); } }); // ajax } // postM }); // jquery