Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created March 21, 2012 10:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkphp/2145914 to your computer and use it in GitHub Desktop.
Save thinkphp/2145914 to your computer and use it in GitHub Desktop.
jsonp usage
var urltwitter = 'http://search.twitter.com/search.json?q=mootools&rpp=5&callback=?'
jsonp.fetch(urltwitter, function(data){
var result = data.results,
out = '<ul>'
for(var i in result) {
out += template(tpl,result[i])
}
out += '</ul>'
document.getElementById('result-twitter').innerHTML = out
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment