Tip:
Highlight text to annotate it
X
To stimulate the AJAX call in JSFiddle, You'll need to use JSFiddle provided AJAX URL
Click "AJAX Request" at the left panel to see the list of AJAX URL list
JSFiddle supports multiple return data type of AJAX call such as HTML, JSON, JSONP and XML
Let's start with JSON
First copy the /echo/json/ and use it as your AJAX URL
The method should be "POST"
Next is the data, we need to pass in a valid JSON
This will be the same JSON object that the server will return back to your success callback function
You don't need to use JSON.parse() as the returned data is already a JSON object
Next, we'll show an example of HTML AJAX call
Use /echo/html/ as AJAX URL
And pass the HTML string as data
Hope this help!
Thanks for watching! Please support us by like this video or subscribe :)