Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- result: 'SUCCESS',
- description: 'Email Added.'
- }
- //This function abstracts away the strangeness in dealing with the eval method and returning JSON objects
- //If there is a better way, let me know
- function ParseJSON(jsonText) {
- var ret = null;
- eval('ret = '+jsonText);
- return ret;
- }
- var ret = ParseJSON(response.value);;
- if(ret.result == 'SUCCESS') {
- //Add a new TR to your table here
- } else {
- //Display the error message here
- // alert(ret.description);
- }
- $("#ajaxLoading").show();
- $.ajax({
- type: "POST",
- url: "/Hoofdgroepen/Add",
- data: "nummer=" + nummer + "&omschr=" + omschr,
- dataType: "html",
- success: function(result) {
- //alert(result);
- $("tr:last").after(result);
- $("#ajaxLoading").hide();
- $("#hfdgrpForm").resetForm();
- }
- });
Add Comment
Please, Sign In to add comment