Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Reference Link : https://www.py4u.net/discuss/930978
- $('#submit').click(function (event) {
- event.preventDefault();
- var data = $.ajax({
- type: 'POST',
- url: '/form',
- async: false,
- dataType: "json",
- data: $(form).serialize(),
- success: function (data) {
- return data;
- },
- error: function (xhr, type, exception) {
- // Do your thing
- }
- });
- if(data.status === 200)
- {
- $('#container').html(data.responseJSON.the_key_you_want);
- }
- });
Add Comment
Please, Sign In to add comment