Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
%%%%%%%%%%%%%%%%% | ||
% NB: after generation add/patch w/ macro | ||
% | ||
% replace | ||
% http://footballdb.herokuapp.com/api/v1/event/en.2012_13/round/2 | ||
% with | ||
% <%= url( '/' ) %>event/en.2012_13/round/2.... twice | ||
%%%%%%%%% | ||
|
||
## Usage | ||
|
||
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="http://footballdb.herokuapp.com/api/event/en.2012_13/round/2?callback=handleGames"></script> | ||
|
||
|
||
Or using the jQuery library using the [`getJSON` function](http://api.jquery.com/jQuery.getJSON): | ||
|
||
$.getJSON('http://footballdb.herokuapp.com/api/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. |