20 lines
416 B
JavaScript
20 lines
416 B
JavaScript
var Session = {
|
|
|
|
user_id: null,
|
|
vk_params: {},
|
|
|
|
query: function(url, params, callback) {
|
|
var q_params = this.vk_params;
|
|
for (attr in params) {
|
|
q_params[attr] = params[attr];
|
|
}
|
|
$.post(url, q_params, callback);
|
|
},
|
|
|
|
setVkParams: function(params) {
|
|
attrs = ['expire', 'mid', 'secret', 'sid', 'sig'];
|
|
for (var i = 0; i < attrs.length; i++) {
|
|
this.vk_params[attrs[i]] = params[attrs[i]];
|
|
}
|
|
}
|
|
} |