0
I am using the code below but getting an error
function readyDom(callback) {
if (/^(interactive|complete)$/i.test(document.readyState)) {
callback();
} else {
document.addEventListener("DOMContentLoaded", callback);
}
}
readyDom(function() {
var navbar = document.createElement("style");
ul.innerHTML = 'body { margin: 0; } ul.spot-nav { list-style-type: none; font-family: Verdana; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li.spot-li { float: left; } li.spot-li a.spot-a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; }';
document.head.appendChild(navbar);
});
readyDom(function() {
var segundos = 1;
setTimeout(function() {
var ul = document.createElement("ul");
ul.className = "spot-nav";
ul.innerHTML = '<li class="spot-li">' +
'<a class="spot-a" href="https://grupospotlight.com" target="_blank"><img src="http://www.grupospotlight.com/assets/img/logo-nav-inverse.png" draggable="false" width="100"></a>' +
'</li>' +
'<li class="spot-li" style="float: right; padding-top: 3px;">' +
'<a class="spot-a" href="https://grupospotlight.com" target="_blank">WWW.GRUPOSPOTLIGHT.COM</a>' +
'</li>';
document.body.insertBefore(ul, document.body.firstChild);
}, 1000 * segundos);
});
I don’t understand javascript, I could do it for me?
– Bruno Antonio
first explain to me what serves each of the three functions that Voce posted
– Italo Rodrigo