$(document).ready(function() {
$('.currency').on('click', function() {
const price = $(this).closest('.priceNum').html();
$('.click_pay').data('price', price);
})
});
let exemple;
const updateExempleValue = () => {
if (exemple === undefined) { //Если переменная undefined то в любом случае стучимся к серверу
exemple = 'ok'; //Здесь ваша фукцния по заданию переменной, вмето 'ok'.
}
return exemple; //Возвращаем переменную
}
async function start(tries = 5, delayTime = 1000) {
for (let i = 1; i <= tries; i++) {
console.log('Try #', i);
try {
return await yourFunction();
} catch(e) {
if (i >= tries) throw e;
}
await delay(delayTime);
}
}
async function delay(time = 1000) {
return new Promise(resolve => {
setTimeout(resolve, time);
})
}
<p>
Здесь видимый текст, далее идёт <span style="display: none;">невидимый текст</span>
</p>
if ($(this).val() !== '') { //Если поле не пустое, значит его не очистили
}
console.log("2" > "11"); //true
console.log(2 > 11); //false
const number1 = parseInt(document.querySelector('.qw').value);
const number2 = parseInt(document.querySelector('.qw1').value);
Papa.parse(fileInput.files[0], {
complete: function(results) {
console.log(results);
}
});
const fileInput = document.getElementById('file-input-id');
<input type="file" id="file-input-id">
$( document ).load(function() {
$('#pagepiling').pagepiling();
)};
function reducer(state = initialState, action) {
if (action.type === 'new') {
state.playload = action.playload;
}
return state;
}
const store = createStore(reducer);
function reducer(state = initialState, action) {
if (action.type === 'new') {
return Object.assign({}, state, {
playload: action.playload
})
}
return state;
}
const store = createStore(reducer);