Quantcast
Channel: jQuery Forum
Viewing all articles
Browse latest Browse all 18

unable to load local json file data on page load of html

$
0
0
$(document).ready(function(){
  alert('Level1'); //this is getting fired

    $.getJSON( "/data/widget.json", function(data) {
  alert('level2');  //not getting fired
          alert(data.widgetData.title);
  });
});

i want to get the JSON data and form html dynamically for the widget....But i'm unable to get the JSON data $.getJSON not working

project structure
-----------------------

WidgetProject
             |-------------> data
             |                   |---------->widget.json
             |-------------->widgetApp.html


widget.json sample code
-------------------------------------------
{
"widgetData": 
{
"title": "Example",
"status": "active",

                 }
}



Viewing all articles
Browse latest Browse all 18

Trending Articles