mercredi 21 novembre 2018

How to ajax multiply JSON files using document.ready . This example doesn't work

$("document").ready(
    function () {
        $.getJSON("French.json", function displayFromJson(french) {

            console.log(french.firstName)

        })
    },
    function () {
        $.getJSON("english.json", function displayFromJson(english) {
            console.log(english.lastName)
        })
    });

//json file 1 { "firstName": "Merci", "lastName": " Claudè" }

//json file 2 { "firstName": "Gracias", "lastName": "Claude" }




Aucun commentaire:

Enregistrer un commentaire