how does getjson work? code example
Example 1: how does getjson work?
$.ajax({
dataType: "json",
url: url,
data: data,
success: success
});
Example 2: how does getjson work?
{
"one": "Singular sensation",
"two": "Beady little eyes",
"three": "Little birds pitch by my doorstep"
}
Example 3: how does getjson work?
$.getJSON( "ajax/test.json", function( data ) {
var items = [];
$.each( data, function( key, val ) {
items.push( "<li id='" + key + "'>" + val + "</li>" );
});
$( "<ul/>", {
"class": "my-new-list",
html: items.join( "" )
}).appendTo( "body" );
});