I would like to display the response of the ajax function below to a div in the dom (update div). How is this to be done without using heavy plugins.
url: 'http://dowmian.com/xs1/getcam.php',
type: 'GET',
data: {id: <?php echo $cam_id; ?>},
success: function(responseText){
},
error: function(responseText){
}
It depends on the return value of your
getcam.phpfunction, but you’re probably looking for thehtml()function:If you want to append the
#update-divdynamically, as in just before the ajax-call, you can do this withappend():References:
ajax()html()append()