On the success function of jquery ajax request, i have to show a div, can anyone suggest a way to do this
dataString = "labid="+val;
jQuery.ajax({
type: "POST",
url: "../pim/manageLabelsAdmin",
cache: false,
data: dataString,
dataType: "json",
success: function(data) {
if(data.success == "yes"){
//alert(data.status);
} else {
alert("Occured internal Error. please check network connection");
}
}
});
If the message to show is in the DOM already, but hidden, you could do something like this in your success callback:
Otherwise you could add the message to the DOM using any of
.append()or.prepend()or.html()or.text()depending on your needs.More on the DOM insertion methods here:
http://api.jquery.com/category/manipulation/dom-insertion-inside/