Created
October 7, 2014 09:55
-
-
Save jpalala/2e5801c8f6281fb3bee1 to your computer and use it in GitHub Desktop.
fun with Zepto.ajax()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//sample ajax call in page | |
(function($){ | |
$.ajax({ | |
type: 'GET', | |
url:'/posts', | |
dataType: 'json', | |
success: function(data) { | |
$.each(data, function(i, item) { | |
$('.container').append('<h2>' + data[i].title + '</h2>'); | |
}); | |
} | |
}) | |
})(Zepto || jQuery); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment