let promises = [];
for (let i = 0; i < 4; i++) {
let promise = fetch("getex.php?i=" + i);
promises.push(promise);
}
Promise.all(promises).then(values => {
values.forEach(function(response) {
response.json().then(function(json) {
console.log(json);
});
});
});
createWall() {
minHeight = 10;
maxHeight = 30;
minWidth = 20;
maxWidth = 40;
width = Random.value * (maxWidth - minWidth) + minWidth;
height = Random.value * (maxHeight - minHeight) + minHeight;
// code to place wall
}
minDistanceBetweenWalls = 100;
distance = 0;
ticker() {
distance++;
if (distance > minDistanceBetweenWalls) {
// some chance to place wall
if (Random.value > .9) {
createWall();
distance = 0;
}
}
}
element.addEventListener("scroll", function() {
if (element.scrollTop > 200) {doSmth}
})
let e = document.querySelector(".iframe-holder iframe");
console.log(e.src);
console.log(e.getAttribute("src"));