„MediaWiki:Common.js” változatai közötti eltérés

Innen: Wiki Grepolis HU
Jump to navigation
Nincs szerkesztési összefoglaló
Nincs szerkesztési összefoglaló
1. sor: 1. sor:
document.body.onload = addElement;
// create a new div element
const newDiv = document.createElement("div");


function addElement() {
// and give it some content
  // create a new div element
const newContent = document.createTextNode('<img alt="FacebookLogo.png" src="/images/thumb/9/9d/FacebookLogo.png/80px-FacebookLogo.png" decoding="async" width="80" height="80" srcset="/images/thumb/9/9d/FacebookLogo.png/120px-FacebookLogo.png 1.5x, /images/thumb/9/9d/FacebookLogo.png/160px-FacebookLogo.png 2x">');
  const newDiv = document.createElement("div");


  // and give it some content
// add the text node to the newly created div
  const newContent = document.createTextNode('<img alt="FacebookLogo.png" src="/images/thumb/9/9d/FacebookLogo.png/80px-FacebookLogo.png" decoding="async" width="80" height="80" srcset="/images/thumb/9/9d/FacebookLogo.png/120px-FacebookLogo.png 1.5x, /images/thumb/9/9d/FacebookLogo.png/160px-FacebookLogo.png 2x">');
newDiv.appendChild(newContent);


  // add the text node to the newly created div
// add the newly created element and its content into the DOM
  newDiv.appendChild(newContent);
const currentDiv = document.getElementById("mirage-sitename");
 
document.body.insertBefore(newDiv, currentDiv);
  // add the newly created element and its content into the DOM
  const currentDiv = document.getElementById("mirage-sitename");
  document.body.insertBefore(newDiv, currentDiv);
}

A lap 2023. augusztus 16., 07:06-kori változata

// create a new div element
const newDiv = document.createElement("div");

// and give it some content
const newContent = document.createTextNode('<img alt="FacebookLogo.png" src="/images/thumb/9/9d/FacebookLogo.png/80px-FacebookLogo.png" decoding="async" width="80" height="80" srcset="/images/thumb/9/9d/FacebookLogo.png/120px-FacebookLogo.png 1.5x, /images/thumb/9/9d/FacebookLogo.png/160px-FacebookLogo.png 2x">');

// add the text node to the newly created div
newDiv.appendChild(newContent);

// add the newly created element and its content into the DOM
const currentDiv = document.getElementById("mirage-sitename");
document.body.insertBefore(newDiv, currentDiv);
Jó játékot kíván: a Grepolis csapata!