vendredi 28 avril 2017

JavaScript not functioning in IE [duplicate]

I am using this JavaScript in order to show a navigation bar below the header. This is the JavaScript:

function insertBefore(el, referenceNode) {
referenceNode.parentNode.insertBefore(el, referenceNode);
}

// example
var navBar = document.createElement('div');
navBar.innerHTML = `
<div class="navbar">Test Nav</div>`;

var ref = document.querySelector('.x-header-landmark');

insertBefore(navBar, ref);

This script works perfectly in Chrome and Firefoxx but does not work in IE. Are there any solutions for this?




Aucun commentaire:

Enregistrer un commentaire