$script_url . '?t=' . time();
// set expires header
header('Expires: Thu, 1 Jan 1970 00:00:00 GMT');
// set cache-control header
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Cache-Control: post-check=0, pre-check=0',false);
// set pragma header
header('Pragma: no-cache');
async function main()
{
let canvas = document.querySelector("#canvas");
canvas.width = 200;
canvas.height = 200;
let ctx = canvas.getContext('2d');
function fun(){
return new Promise((resolve, reject) => {
let dataUrl = "no";
let img = new Image()
img.onload = () => {
ctx.drawImage(img, 0, 0, img.width, img.height);
dataUrl = canvas.toDataURL();
resolve(dataUrl)
}
img.onerror = reject
img.src = "/img/fallback/logo-adunit.jpg";
})
}
let dataUrl = await fun();
document.querySelector("#print").innerText = dataUrl;
}
main()
inp.addEventListener('keyup',()=>{
for(let key in codes){
if(inp.value === key){
info.textContent = `${codes[key]}`;
info.style.display = 'block';
} else {
info.style.display = 'none';
}
};
});
inp.addEventListener('keyup',()=>{
if(inp.value in codes) {
info.textContent = `${codes[inp.value]}`;
info.style.display = 'block';
}
else {
info.style.display = 'none';
}
});
<select onchange="checkValue(this.value)">
<option> Один</option>
<option> два</option>
<option> три</option>
</select>
<select id="abc">
<option> выкл</option>
<option> выкл</option>
<option> выкл</option>
</select>
const checkValue = val => {
document.getElementById('abc').disabled = val === 'три';
}