Skip to content

Instantly share code, notes, and snippets.

@terrysahaidak
Created June 20, 2015 11:46
Show Gist options
  • Save terrysahaidak/4dc198b1c1810e72424a to your computer and use it in GitHub Desktop.
Save terrysahaidak/4dc198b1c1810e72424a to your computer and use it in GitHub Desktop.
ajax adapter
App.Adapter = {
ajax: function(method, options, token) {
var options = options || {};
options.dataType = 'json';
var str = Object.keys(options).map(function(key){
return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]);
}).join('&');
return ic.ajax.request('https://api.vk.com/method/' + method + '?' + str + '&access_token=' + token);
}
};
export default App.Adapter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment