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/

2
  • 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. Commented Mar 13, 2013 at 17:55
  • If you're talking about using JavaScript to read an external JSON file, then there's a discussion about that here. Commented Mar 20, 2013 at 21:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.