при обращении к элементу в JS и изменении стилей методом style DOM деревоНе скажу как раньше было, но и сейчас при неудачной вёрстке можно вызвать reflow для всего документа даже при применении класса. Изменение шрифта и так и так заставит браузер что-то пересчитать.
fetch(url)
.then((response) => response.json())
.then(({ cart }) => cartStore.setCart(cart))
.catch(e=>console.log(e))
.finally(() => setPreloader(false));
fetch(url)
.then((response) => response.json())
.then(({ cart }) => {cartStore.setCart(cart); setPreloader(false)} )
.catch(e=>{console.log(e); setPreloader(false)})
const point = { x: 0, y: 0 };
function alertPointSubscriber(point){
alert(point.x * point.y);
}
const subscribers = [];
const handlePointChange = {
set(obj, prop, value) {
subscribers.forEach(susb => susb(obj));
if ((prop === 'x') || (prop === 'y') ) {
console.log('set ' + prop + '=' + value);
} else {
console.log('unhandled');
}
return Reflect.set(...arguments);
}
};
const points =[];
points.push(new Proxy(point, handlePointChange));
points[0].x=10;
points[0].y=20;
subscribers.push(alertPointSubscriber);
points[0].z=3;
console.log(point);
import $ from 'jquery'
window.jQuery = window.$ = $
document.addEventListener('DOMContentLoaded', function () {
// init lightslider
}, false);
newCtx.drawImage(oldCtx, 0, 0, img.width, img.height);
Подскажите пожалуйста, почему так?
@foreach ($categories as $category)
<option
value="{{ $category }}"
{{ request()->get('transaction')==$category? 'checked':null }}
>{{ $category }}</option>
@endforeach
.then( response => {
if (response.status >= 200) {
// console.log(response)
return Promise.resolve(response)
} else {
return Promise.reject(new Error(response.statusText)) //new MyFetchError
}
})
.then(response => response.json())
.then(success => console.log(success))
.catch...
// псевдо
<template v-for="farm in farmDirecory" :key="farm.id">
<tr>
<td>{{farm.number}}</td>
</tr>
<template v-if="farm.annexes">
<tr><th>Приложения</th></tr>
<tr v-for="f in farm.annexes">
<td>{{f.number}}</td>
</tr>
</template>
</template>
...
else {
header("HTTP/1.1 401 Bad Captcha");
echo "Вы не правильно ввели сумму чисел с картинки";
}
var url = window.location.pathname;
var searchUrl = url.split('/').slice(0,-1).join('/')+'/';
/* все адреса на странице без указания документа должны заканчиваться на "/"
( /motherboards/ и /motherboards в данном случае - важное различие) */
$(".main_menu li a[href*='" + searchUrl + "']").
.closest('.main_menu li').addClass('active')
.end()
.parents('.main_menu>ul>li').addClass('active');
открываются по клику...
и
... на второй уже не переключиться по ховеру
var l={
list: {
"action_buttons[0]": "View",
"action_buttons[1]": "Share",
"action_buttons[2]": "Download",
"columns[0]": "Date of Study",
"columns[1]": "Patient",
"columns[2]": "File name",
"columns[3]": "Reporting <br>Physician",
"columns[4]": "Institution"
}
};
var n = {};
for (var item in l.list) {
if (l.list.hasOwnProperty(item)) {
r = item.replace(/\[\d\]/,'');
if(n[r]==undefined){ n[r]=[] }
n[r].push(l.list[item]);
}
}
l.list = n;
console.log(l);
var regex1 = RegExp('^[A-Z]{5}[A-Z]*$', 'i');
var str1 = 'asaas1a';
console.log(regex1.test(str1));