ExampleGet JSON data using an AJAX request, and output the result:
Try it yourself » |
The getJSON() method is used to get JSON data using an AJAX HTTP GET request.
$(selector).getJSON(url,data,success(data,status,xhr)) |
Parameter | Description |
---|---|
url | Required. Specifies the url to send the request to |
data | Optional. Specifies data to be sent to the server |
success(data,status,xhr) |
Optional. Specifies the function to run if the request succeeds Additional parameters:
|