简体   繁体   中英

IE is throwing a `Object doesn't support property or method 'defineProperty'` in Zurb foundation.min.js. Is there a fix or work around?

I have a Drupal site with Zurb Foundation 6.2. When I try to run the site in IE 11 all the layout is broken and I get an error:

Object doesn't support property or method 'defineProperty'

in foundation.min.js.

This method appears several times in foundation.js, eg:

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

and I don't feel confident in altering it or screwing around with Foundation.

I read somewhere that this could also be caused if an HTML element has an ID of the same name so I brought up the page source of the page and searched, but found nothing.

Would anyone know if there's is a fix or workaround for this?

As @Jaromanda and @Teemu suggested, this was because IE was always starting in 5 mode. This was because of my companies set up with its intranet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM