browser lang:en
JSONP is a technique that allows you to transfer JSON data across multiple domains.
jQuery now supports JSONP natively - if you attempt to load JSON (via $.getJSON or $.ajax) from a remote URL then an extra callback will be provided for the server to interpret. Additionally, if the server requires a special field for specifying your own callback name you can provide it by having a "=?" in your query string.
Example:
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?", function(data){
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images")
.wrap("<a href='" + item.link + "'></a>");
if ( i == 3 ) return false;
});
});
});
</script>
<style>img{ height: 100px; float: left; }</style>
</head>
<body>
<div id="images"></div>
</body>
</html>
Selective Tweets is an application that allows you to control what tweets are added to your Facebook…
in:Social Networking (0 comments)In a FBML Facebook App, your quick jump menu will require a little tweak to work in FBJS…
in:Scripts and tutorials (0 comments)Every single day, someone, somewhere is discussing something important to your business; your brand, your executives, your…
in:Scripts and tutorials (0 comments)Although some IT managers are coming around to the idea of supporting iPhones, most aren’t convinced…
in:Free Software (0 comments)When you want to run your own mail server, and it does not matter what version and…
in:Apache - .htaccess (0 comments)Have you ever had to develop something yourself only to find out that there had already been…
in:JQuery (0 comments)The situation begins with your blog or website and you need to post some code on a particular…
in:The Holy Faq's (0 comments)So. Google just recently announced Google Buzz. I’m not sure about you, but I…
in:Blog (0 comments)
