Cambiando getJSON a JSONP
Tengo este codigo
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$.getJSON('http://example.com/api/get_cats', function(fbResults) {
document.write(fbResults.cats[0].title);
});
});
</script>
¿Cómo puedo cambiar este código?
<script>
$(document).ready(function() {
$.getJSON('http://example.com/api/get_cats', function(fbResults) {
document.write(fbResults.cats[0].title);
});
});
</script>
para que funcione como JSONP ... ¿Es esto totalmente diferente?