From 9626777ae83294578c7d6e5a8f1570b7eac88bad Mon Sep 17 00:00:00 2001 From: Gerald Bauer Date: Mon, 2 Sep 2013 19:09:03 +0200 Subject: [PATCH] add usage.md --- lib/sportdb/service/views/_usage.md | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/sportdb/service/views/_usage.md diff --git a/lib/sportdb/service/views/_usage.md b/lib/sportdb/service/views/_usage.md new file mode 100644 index 0000000..1927a21 --- /dev/null +++ b/lib/sportdb/service/views/_usage.md @@ -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): + + + + + + +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.