jQuery with json

Posted by coure06 on Stack Overflow See other posts from Stack Overflow or by coure06
Published on 2010-03-23T09:43:28Z Indexed on 2010/03/23 9:53 UTC
Read the original article Hit count: 385

Filed under:
|

I have the following json code file named: sections.json

{
    "section1": { "priority": 1, "html": '<img src="../images/google.png" />'},
    "section2": { "priority": 2, "html": '<input type="button" value="Login" />'},
    "section3": { "priority": 3, "html": '<div>Some text</div>'},
    "section4": { "priority": 4, "html": '<div>Some text</div>'},
    "section5": { "priority": 5, "html": '<select><option>option1</option> <option>option2</option></select>'}
}

I am trying this in jquery code but alert is not working

$.getJSON("sections.json", function(json) {
    alert('h');
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JSON