var person = {
firstName: "John", // здесь могут быть внутренние переменные
lastName : "Doe",
id : 5566,
fullName : function() {
return this.firstName + " " + this.lastName;
}
};
// и потом где надо
let name = person.fullName();
function superFunction(event){
event.preventDefault();
$.post({
url: '/login',
data: {'_token': $('meta[name="csrf-token"]').attr('content'),'id':$('#id').val()}
})
.done(function (data, textStatus, xhr) {
console.log( 'From .done() data: '+data + ' textStatus: ' + textStatus + ' xhr: ' + xhr + ' ');
});
}
$('#mySelect2').select2({
ajax: {
url: 'https://api.github.com/orgs/select2/repos',
data: function (params) {
var searchStr = params.term.replace('-', ''); // удаляете тире из строки, перед поиском
var query = {
search: searchStr, // вот здесь изменяйте текст запроса - по умолчанию params.term
}
return query;
}
}
});
function readTextFile(file)
{
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function ()
{
if(rawFile.readyState === 4)
{
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
alert(allText);
}
}
}
rawFile.send(null);
}
readTextFile("file:///C:/your/path/to/file.txt");
img {
-webkit-filter: grayscale(100%); /*для safari 6.0 - 9.0 */
filter: grayscale(100%);
}