SCRIPT5039: Redeclaration of const property using IE9

痞子三分冷 提交于 2019-12-11 14:29:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!