surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.23k stars 817 forks source link

Replace window with globalThis #8912

Closed kesavkolla closed 1 month ago

kesavkolla commented 1 month ago

Replaced window with globalThis. This will fix the issue #8911

dmitry-kurmanov commented 1 month ago

@kesavkolla Thanks for the contribution!

Unfortunately, according to https://caniuse.com/?search=globalThis the globalThis does not supported by IE11. Probably we could improve the PR via some extra code:

let gcontext = globalThis;

if (typeof globalThis === "undefined") context = window;

let jQueryInst = context ["jQuery"] || context ["$"];

What do you think?

kesavkolla commented 1 month ago

Added check for globalThis and fallback to window.