Soup
Soup

Reputation: 137

Where can I practice making AJAX calls?

I'm learning to make AJAX calls with jQuery and rendering the data with template engines like Mustache, Handlebars.js, and JSRender.

Is there a website or web service I can use to practice making AJAX calls and rendering them in HTML? Because of cross-domain scripting, I'm guessing there isn't a public data storage I can practice making calls with. Does a web service like this exist?

Upvotes: 3

Views: 5502

Answers (1)

Andrew Whitaker
Andrew Whitaker

Reputation: 126072

JSFiddle is actually a really good place to do this. You can make JSFiddle "echo" html or JSON that you want to get back:

$.ajax({
    type: "POST",
    url: "/echo/json/",
    data: {
        json: JSON.stringify(
            { hello: "world" }
        )
    },
    success: function (data) {
        /* populate a template, etc. */
    }
});

You can also add external resources (like a templating plugin). Here's an example using mustache.js from cdnjs.

Upvotes: 10

Related Questions