Permalink
Browse files

browser added

  • Loading branch information...
AlgoTrader committed Dec 14, 2012
1 parent 5ef157e commit 5dfc87f95e4d41d8ec9b67a73ddd9fe207f6adc2
Showing with 36 additions and 0 deletions.
  1. +36 −0 browser/betfair.js
View
@@ -0,0 +1,36 @@
+// jQuery should be loaded before this script
+// $.post is used from there
+
+function betfair($, key) {
+ var url = "https://beta-api.betfair.com/json-rpc"
+ var appKey = key;
+ var id = 1;
+
+ function invokeMethod(method, params, cb) {
+ var inv = {
+ "jsonrpc" : "2.0",
+ "id" : id++,
+ "method" : "SportAPING/v1.0/"+method,
+ "params" : params
+ };
+ var ajax = {
+ url: url,
+ headers: {
+ 'X-Application' : '123',
+ 'X-Authentication' : '123',
+ }
+ type: "POST"
+ };
+
+ function onDone() {
+ alert("done");
+ }
+ function onFail() {
+ alert("fail");
+ }
+ $.ajax( {
+ }, inv ).done(onDone).fail(onFail);
+ }
+
+
+}

0 comments on commit 5dfc87f

Please sign in to comment.