Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the following code snippet to combine Ajax Get method with jQuery append:

$.get(url, function(data){
  $(selector).append(data);
});

In the above code, url is the URL to send the GET request to and selector is the jQuery selector for the element where you want to append the data.

The $.get() method sends an HTTP GET request to the specified URL and returns the data received as the first argument of the callback function.

The append() method is used to append content to the selected elements.

So, when the GET request is successful, the returned data is appended to the selected elements using the append() method.

Make sure to replace the url and selector variables with your own values.