async getAllMembers(id) {
try {
return await model.query('select * from `group_members` where `group_id` = ?', [id]);
} catch(e) {
return e;
}
}
function multiply(){
if( arguments.length === 0 ) {
return 0;
}
let calc = 1;
for(let i = 0, len = arguments.length; i < len; i++){
calc = calc * arguments[i];
}
return calc
}
let corsOptions = {
origin: 'http://front.xxx.ru',
optionsSuccessStatus: 200,
credentials: true
};
app.use(cors(corsOptions));
$httpProvider.defaults.withCredentials = true;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.open('POST', 'http://xxx.ru', true)
$.ajax({
///
crossDomain: true,
///
});
const session = require('express-session');
const sessionStore = require('express-mysql-session');
function f(){};
if (f) {
alert(typeof(f));
}
let list = $('.list');
let url = list.data('url');
let lang = list.data('lang');
list.typeahead({
onSelect: function(item) {
console.log(item)
},
ajax: {
url,
data: {lang},
method: "post",
triggerLength: 1,
preDispatch: function(query){
return {name:query};
},
}
});
function Human(name) {
Human.country = 'USA';
this.name = name;
console.log('Имя: '+this.name);
console.log('Страна: '+Human.country);
}
let vasya = new Human('Вася');
let maria = new Human('Маша');
$('#checkbox').change(function() {
if($(this).prop('checked')) {
$.ajax({
///
///
data: {
prop: $(this).data('propertyName')
}
//
//
});
}
});