I have some jQuery code. I have called an Ajax function file, file.php, that has some fields, like:
Milk
The success function takes a parameter, which contains the fetched data. So in your example:
$(document).ready(
function(){ $.ajax({
type:"GET",
url:"file.php",
data:id,
success:function(txt){
$.prompt( txt,{ opacity: 0.2 });
},
// ... more ...
}
});
More examples are in the jQuery documentation.
jQuery.ajax({
type:"POST",
url:"file.php",
data:"id1="+val1+"&id2="+val2,
success:function(data){
jQuery("#div_id").html(data);
}