I’m getting a junk of JSON data and would like to work with that data without refreshing the site.
There are two divs:
- items
- item
If the user selects an item from the items list, div#item should be displayed instead of div#items with the item data. In Jade, I have to check if the item data has been defined:
- if(typeof(item) != 'undefined')
The click is handled by jQuery and I’m filling item with the corresponding data, hiding #items and showing #item, but due to the if-clause, Jade doesn’t get that item now has a value.
I really would like to stick to the single request and do most of the data handling on the client-side as every refresh of the page automatically loads all the JSON data again. What would be the best solution for that?
Should I put the data into an HTML5 store?
Thanks
I found a workaround by just filling the div from jQuery with the .html() function. Anything better is highly appreciated.