ggalan
06-16-2011, 07:21 PM
what is the best way to trigger a ajax call after the post happens?
this is what i have
function ajaxCall(name, prodid){
$.ajax({
type: "POST",
url: "shortList.php",
data: ({'name':name, 'prodid':prodid }),
success: function(msg){
$('#listColumn').html(msg);
}
});
}
$("#output a").click(function () {
var name = $(this).text();
var prodid = $("#prodid").val();
$.post("class/i.Name.php", { name: name, prodid: prodid },
function(data){
$("#listColumn").html(data);
});
ajaxCall(name, prodid);// trigger this after all the above is done
});
this is what i have
function ajaxCall(name, prodid){
$.ajax({
type: "POST",
url: "shortList.php",
data: ({'name':name, 'prodid':prodid }),
success: function(msg){
$('#listColumn').html(msg);
}
});
}
$("#output a").click(function () {
var name = $(this).text();
var prodid = $("#prodid").val();
$.post("class/i.Name.php", { name: name, prodid: prodid },
function(data){
$("#listColumn").html(data);
});
ajaxCall(name, prodid);// trigger this after all the above is done
});