I am Working on Javascript on a jenkins plugin using maven and I have this code:
function arrayElements(element, index, array)
{
var arrayPaths = element.split("\\");
var projectSource = arrayPaths[2];
var array = element.split("_");
if (projectSource === global ) {
if (array[2]===filtro){
document.getElementById("source").options.add(new Option(arrayPaths[3], element));
}
}
}
function fillCompiledSource(object, projects)
{
document.getElementById("source").innerHTML = "";
global = document.getElementById("branches").value;
projects.forEach(arrayElements)
}
var projects = new Array();</script><script>
function fillCombo()
{
document.getElementById("source").innerHTML = "";
global = document.getElementById("branches").value;
var array = document.getElementById("branches").value.split('/');
global = array[1];
projects.forEach(arrayElements)
}
This fail only in internet explorer and only when document Mode is IE8 standarts I don't know what is the reason and how I can resolve that..
Pd: The Internet explorer is 10
forEach() is actually working on IE11, just be careful on how you call it. querySelectorAll() is a method which return a NodeList. And on Internet Explorer, foreach() only works on Array objects. (It works with NodeList with ES6, not supported by IE11).
Open up IE 11 and you will find “Object doesn't support property or method 'forEach'” in the console. If you do some googling you will find a lot of responses on stackoverflow that include NodeList. prototype. forEach = Array.
Yeap, its because IE8 does not implement Array.forEach
(neither many other more modern JS methods). If you need to work in IE8, you will have to shim it (see the compatibility section).
By the way, MDN has resources for most of the other unsupported methods too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With