Saturday, 3 March 2018

javascript - Running ajax call on specific form name

I just wanted to know how I can run a function on a specific form name? instead of just any form.. my code is below you don't really need to know anything else, its for an ajax call.



$('form').on('submit', function (e) {
e.preventDefault();

$.ajax({
type: 'post',
url: '/assets/hk/ajax/muteorban.php',
data: $('form').serialize(),
success: function (data) {

var div = document.getElementById('contentArea_muteorban');
div.innerHTML = div.innerHTML + data;
}
});

});

});

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...