function saveAjax() { $.ajax({ type: "POST", async: false, contentType: "application/json", dataType: 'json', url: (location.href).replace("register", "registersave"), dat: JSON.stringify( querystr ), success: function(success) { $("#zad").html(success); } }); };