//header set to "application/json"
{items : [{'10100':['huc6':10100, 'name':'St. John', 'historic_d':28, 'abslolute_loss':0, 'percent_loss':0.0000, 'fillColor':'#1ae8ff']},{......
And I want to read this content from javascript. I could have put things in js as var myJson = [the json content] but I would want to learn things via "link" way. Please do share your wisdom a bit
Regards,
Dee
Last edited by novice4eva on Thu Oct 20, 2011 2:38 pm, edited 1 time in total.
Hi pickle,
Thanks for taking interest into this and I am really sorry for getting back to this - LATE(5 days to be exact!). I meant something like this:
Libraries like simile exhibit read json data using this method. But I am not able to dissect how?
and myJsonData.json would have content as posted in my first thread.
So you just want to be able to access the information in myJsonData.json & work with it in Javascript? I honestly don't know why you would put it in a <link> tag. That wouldn't bring the JSON data into your Javascript environment. You'd have to access the tag with Javascript & make another call to the URL specified by the "href" attribute, resulting in the data being downloaded twice.
Putting it in a <script> tag would make way more sense.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Hummm now that's interesting..shoot you are right they are making an ajax call because I always saw a get request being made in the firebug console for the json file BUT damn, it never crossed my mind. Pickle thanks a lot - I think I get it how they(simile exhibit) are doing it now. I thought they were somehow loading the content via the link - and felt like wow that's neat. Thank you so much again. I wish I had a smiley to show you my appreciation for "bringing me into light"