<div id="coub">
<div class="coub" onmouseover="showName(this);">
<a href="//coub.com/view/eeuyn" onclick="return frame(this);">
<img src="https://3fc4ed44-3fbc-419a-97a1-a29742511391.selcdn.net/coub_storage/coub/simple/cw_image/f42a9c98bfd/f876723cdbb307c191e94/1472200578_00031.jpg"></a>
<span>Watch on the road! #jimdrives</span></div>
<div class="coub" onmouseover="showName(this);">
<a href="//coub.com/view/2q1t7k" onclick="return frame(this);">
<img src="https://3fc4ed44-3fbc-419a-97a1-a29742511391.selcdn.net/coub_storage/coub/simple/cw_image/27475bd9033/6a9fb30fb888702736ce6/%{version}_1615659518_00032.jpg"></a>
<span>Everyone!</span></div>
</div>
const images = Array.from(document.querySelectorAll('img'));
images.forEach((image) => {
let src = image.getAttribute('src');
src = src.replace('%{version}', 'small');
image.setAttribute('src', src);
});
const loadedModule = require('./modulePath/index.js');
loadedModule.counter()
console.log(loadedModule.awesomeValue);
<head>
или в самое начало <body>
, чтобы он выполнился при парсинге этого места браузером; и не ссылкой, а напрямуюfunction a () {
var a = "";
for(var b = 0; b < 10; b++) {
var b = "";
console.log(a);
}
console.log(a, b); // Этот код не приведет к ошибке так как у var функциональная видимость.
}
function a () {
let a = "";
for(var b = 0; b < 10; b++) {
let b = "";
console.log(a);
}
console.log(a, b); // Этот код приведет к ошибке так как у let блочная видимость.
}