问题
I am optimizing my website across IE browsers. Everything works fine except for IE9.
I have a function similar to this one:
var history = new Array();
function loadPage(page, parameters) {
$(".dynamic_load").fadeOut(400, function(){
$(this).fadeIn(400).html("loading").load(page, parameters,
function(response){
$(".dynamic_load").html(response).show(); });
if (history.length > 5) {
history.shift();
}
history.push(page);
});
}
and I am getting an error SCRIPT5039: Redeclaration of const property , which indicates on line
var history = new Array();
What does it mean? I haven't declared it anywhere else. It is just a global array.
回答1:
It is probably conflicting with window.history. Rename it to something else and see if the error goes away.
回答2:
Btw: Using screen
as variable name in IE9 causes the same issue.
来源:https://stackoverflow.com/questions/9676882/script5039-redeclaration-of-const-property-using-ie9