Saturday 19 May 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...