In your hypertext (HTML) document using a plain vanilla cross-domain JavaScript request (using the JSONP technique):
<script>
function handleGames( json ) {
// Do something with the returned data
}
</script>
<script src="<%= url( '/' ) %>event/en.2012_13/round/2?callback=handleGames"></script>
Or using the jQuery library using the getJSON
function:
$.getJSON('<%= url( '/' ) %>event/en.2012_13/round/2?callback=?', function(json) {
// Do something with the returned data
});
Note: Add the callback=?
query parameter to tell jQuery to use a cross-domain JSONP request.
That’s it.