From 9ba61ebd7fc87dcaaddcd34dcd7f39e2858cefed Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Mon, 27 Apr 2015 17:29:43 +0200 Subject: Jade <3, BotleaguesApi.js --- src/js/BotleaguesApi.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/js/BotleaguesApi.js (limited to 'src/js') diff --git a/src/js/BotleaguesApi.js b/src/js/BotleaguesApi.js new file mode 100644 index 0000000..44e9c0e --- /dev/null +++ b/src/js/BotleaguesApi.js @@ -0,0 +1,22 @@ +function BotleaguesApi(){} + +BotleaguesApi.url = 'https://api.local.botleagues.camilstaps.nl'; + +BotleaguesApi.request = function(user_options) { + var options = { + endpoint: null, + method: 'GET', + dataType: 'jsonp', + jsonp: 'callback' + }; + for (var name in user_options) { + options[name] = user_options[name]; + } + + console.log(options); + + var url = BotleaguesApi.url + options['endpoint']; + delete options['endpoint']; + + jQuery.ajax(url, options); +} \ No newline at end of file -- cgit v1.2.3