Note that there are some explanatory texts on larger screens.

plurals
  1. POjson2.asp data parsing not working
    primarykey
    data
    text
    <p>I'm using <code>aspjson</code> (json2.asp) to parse data from <code>factual.com</code> but I'm having some problem.</p> <p>The structure of the json data is the following:</p> <pre><code>{ "version":3, "status":"ok", "response":{ "data":[ { "address":"12725 SW Pacific Hwy", "alcohol":true, "attire":"casual", "category_ids":[358], "category_labels":[["Social","Food and Dining","Restaurants","Italian"]], "country":"us","cuisine":["Italian","Pizza","Deli","European","Cafe"], "factual_id":"22f39245-7435-4e64-b288-9d84f6f20df9", "groups_goodfor":true, "kids_goodfor":true, "latitude":45.42775, "locality":"Portland", "longitude":-122.77711, "meal_breakfast":true, "meal_cater":true, "meal_deliver":false, "meal_dinner":true, "meal_lunch":true, "meal_takeout":true, "name":"New York New York", "neighborhood":["Bull Mountain","Tigard","Robinson","SW Portland","Jean","Greton"], "parking":true, "parking_lot":true, "parking_street":true, "postcode":"97223", "price":2, "rating":3, "region":"OR", "reservations":true, "seating_outdoor":true, "status":"1", "tel":"(503) 443-2404", "website":"http://www.nynytigard.com", "wifi":false}, and many other records....... }] } </code></pre> <p>This is the script i'm using on the ASP page to parse the data:</p> <pre><code>url_factual="http://api.v3.factual.com/t/restaurants-us?q=%22New%20York%22&amp;KEY=MY_KEY" set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") xmlhttp.open "GET", url_factual, false xmlhttp.send "" Dim oJSON Set oJSON = New aspJSON oJSON.loadJSON(xmlhttp.responseText) for each data_object in oJSON.data("response") for each elemento In oJSON.data("response").item("data") response.write(oJSON.data("response").item("data").item("address") &amp; "&lt;br&gt;") response.write(oJSON.data("response").item("data").item("attire") &amp; "&lt;br&gt;") response.write("----------------------------------------------------&lt;br&gt;") next next 'Response.Write oJSON.JSONoutput() Set oJSON = Nothing set xmlhttp = nothing </code></pre> <p>The problem is that I got no values. what's wrong in the code? Thanks for your precious help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload