var data = 'data'; $.ajax({ url: "temp.do", type: "post", data : { "data" : data }, async: false, error : function(error) { console.log(error); }, success: function () { } });