Showing posts with label jsonp. Show all posts
Showing posts with label jsonp. Show all posts

Friday, June 1, 2012

Monday, May 21, 2012

jQuery ajax (jsonp) ignores a timeout and doesn"t fire the error event


Hey fellow jQuery lovers,



To add some basic error handling, I wanted to rewrite a piece of code that used jQuery's $.getJSON to pull in some photo's from Flickr. The reason for doing this is that $.getJSON doesn't provide error handling or work with timeouts.

Friday, April 6, 2012

Is this safe for providing JSONP?



<?php header('content-type: application/json');

$json = json_encode($data);

echo isset($_GET['callback'])
? "{$_GET['callback']}($json)"
: $json;