0

I have a basic app http://jsfiddle.net/p3hpZ/ which uses data hardcoded in the script.js file like so:

//model data 
var things = [   
{ title: "Macbook Air", price: 799, id: 1 },   
{ title: "Macbook Pro", price: 999, id: 2 },   
{ title: "The new iPad", price: 399, id: 3 },   
{ title: "Magic Mouse", price: 50, id: 4 },   
{ title: "Cinema Display", price: 799, id: 5 } 
];

I am trying to work out how to move the data into a seperate .json file. Here is what I have so far http://jsfiddle.net/wVsZh/

user1469779
  • 2,541
  • 4
  • 18
  • 21
  • You need to supply more information about the problem you are facing. There are errors in the fiddles so no way to test your code. – snedkov Mar 13 '13 at 17:55
  • If you're talking about using JavaScript to read an external JSON file, then there's [a discussion about that here](http://stackoverflow.com/questions/6711002/how-can-i-get-javascript-to-read-from-a-json-file). – Wil Mar 20 '13 at 21:13

0 Answers0