<input type="text" class="form-control" id="f15" value={abroaddata.abroaddeftext + abroaddata.abroadtext} on:input={abroadTextFilter}>
let abroaddata = {
inostr:true,
hrv:false,
bih:false,
srb:false,
alb:false,
abroaddeftext:"inostranstvo",
abroadtext:""
}
function abroadTextFilter(e) {
let indx = e.target.value.indexOf(abroaddata.abroaddeftext)
if (indx !== 0) {
e.target.value = abroaddata.abroaddeftext
return;
}
abroaddata.abroadtext = e.target.value.slice(abroaddata.abroaddeftext.length)
}
никак не сделать
чем сложнее хотелка, тем хитрее решение.
Cookies.set('name', 'value', { expires: 7, path: '' })
return
из whilelet num = 4; // задается функцией .
const smallestDivisor = (num) => {
let divider = 1;
if (num % 2 === 0 && num > 0) {
//return num;
return 2
} else if (num <= 0) {
return NaN;
} else {
while (num % divider === 1) {
divider = divider + 1;
//return divider;
}
return divider;
}
}
//console.log(smallestDivisor(num)) //=>4
<a on:click={click}>test</a>
document.querySelectorAll('#buttons div a').forEach(function(el) {
if ( window.location.pathname == el.href) {
el.classList.add('active');
}
});
if (data.success) {
successCallBack(); /// <== Сюда нужно передать
}
function apiCallback(data, successCallBack) {
if (data.success) {
successCallBack(data); //// <=== data
} else {
new ApiError(data.data);
}
}
"body": JSON.stringify({
web:{
"applicationPubKey":"BBAMlBDE6qiir8vEXPyYPwHhVt7zZ40HeyT0v1AIUeC4l1j7xXfTNYQthsf36_W0setCp6-683jptFBSTId7mps",
auth:subscribe.keys.auth,
endpoint:subscribe.endpoint,
p256dh:subscribe.keys.p256dh
}
}),