$.getJSON
is asynchronous so you should do:
$.getJSON("test.json", function(json) {
console.log(json); // this will show the info it in firebug console
});
More Related Contents:
- Convert form data to JavaScript object with jQuery
- jQuery AJAX cross domain
- AJAX cross domain call
- jQuery.parseJSON single quote vs double quote
- Ajax request returns 200 OK, but an error event is fired instead of success
- Chrome refuses to execute an AJAX script due to wrong MIME type
- jQuery returning “parsererror” for ajax request
- C# Web method is not calling in javascript
- Get data from PHP array via AJAX and jQuery
- When to prefer JSON over XML?
- How can I use JSON data to populate the options of a select box?
- Loop through JSON object List
- Iterating through/Parsing JSON Object via JavaScript
- jQuery JSON looping through nested objects
- jQuery AJAX Call to PHP Script with JSON Return
- console.log(result) prints [object Object]. How do I get result.name? [duplicate]
- how to read json result in jquery?
- Trying to load local JSON file to show data in a html page using JQuery
- Execute function after Ajax call is complete
- How to get the JSON with duplicate keys completely in javascript
- Uncaught TypeError: data.push is not a function
- How to compare two JSON have the same properties without order?
- how to convert xml to json using jquery
- Creating a JSON dynamically with each input value using jquery
- Nested JSON: How to add (push) new items to an object?
- Why does the jQuery JSON parser need double escaping for backslashes?
- jQuery uses (new Function(“return ” + data))(); instead of eval(data); to parse JSON, why?
- creating highchart with ajax json data
- Ordered JSONObject
- Grouping JSON by values