Ändern von getJSON in JSONP
Ich habe diesen Code:
<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>
Wie kann ich diesen Code ändern:
<script>
$(document).ready(function() {
$.getJSON('http://example.com/api/get_cats', function(fbResults) {
document.write(fbResults.cats[0].title);
});
});
</script>
damit es als JSONP funktioniert ... Ist das völlig anders?