Disable 'use strict' in Google Maps Drawin

2020-08-09 05:50发布

问题:

Is it possible to turn off 'use strict' within the Google maps drawing library (accessed through http://maps.google.com/maps/api/js?libraries=drawing&sensor=false).

This has never been an issue for me before but as I'm sure some of you are aware, JavaScript's strict mode is incompatible with asp.net's __doPostBack method and throws an error in Firefox and Chrome( Illegal access to a strict mode caller function, or access censored in ff).

Alas both the drawing library and the ability to __doPostBack are imperative to the application I am working on, so I cannot simply remove one or the other.

As far as I am aware it is not possible to simply download the library independently of the full maps api and comment out the offending line. If I am wrong on this I will be overjoyed.

I wasn't sure whether or not to tag this as JavaScript so If I was in the wrong there apologies.

Any help greatly appreciated.

Chris.

回答1:

Just download the library, save it as .js, and comment out (or remove) the "use strict" line.