Saturday, May 19, 2018

how to cancel fired event in jQuery and JSON?

I have a div and when click it ,it goes to fetch some information from server and put themes to itself content to show it to user it works fine but I do not know how to handle it ,when user clicked on other part of page cancel this event that fired?




 



my function:



function getit(picdiv, pid) {

$('#picdiv').html('please wait...');


$.ajax({
url: "/Getcontent",
type: 'POST',
dataType: 'json',
data: null,
contentType: 'application/json; charset=utf-8',
success: function (content) {
$('#picdiv').html(content);

},

error: function (content) {
//do something
}
});
}

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...