json - How to use jQuery.getJSON() and print it in a bootstrap modal -
i'm student , real beginner jquery , want know how make jquery.getjson()
read local file , print in modal (bootstrap)
here's local file (fruits.json)
{ name: “apple”, image: “./img/imag_apple.jpg”, description: “tasty apple”, pricekg: 34, taxes: 16, number: 28 } { name: “orange”, image: “./img/imag_orange.jpg”, description: “tasty orange”, pricekg: 34, taxes: 16, number: 28 } { name: “lime”, image: “./img/imag_lime.jpg”, description: “tasty lime”, pricekg: 34, taxes: 16, number: 28 }
you add grab data response of getjson()
, add modal.
jquery.getjson(url, function (data) { var jsonobj = json.stringify(data); // add data modal });
Comments
Post a Comment