冲突一、Array.prototype.push函数冲突
Discuz 7.0版本为了兼容低版本的IE,重写了Array的push方法,代码位于include/common.js中,如下:
1
2
3
4
|
Array.prototype.push function (value) this [ this .length] return this .length; } |
但以上代码没有做任何检测直接进行了覆盖导致冲突,解决办法是修改为如下代码:
1
2
3
4
5
6
|
if ( typeof Array.prototype.push 'undefined' ) Array.prototype.push function (value) this [ this .length]
|