Skip to content

IE compatibility #23

@yepzy

Description

@yepzy

I found that your package make webpages not working on IE 11.

And I found why, it's because in the function getJsHelper of the file src/SharedData.php, the JS code generated use a default parameter (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters) in a function that is not compatible with IE.

Here is a correction that I tried and works well on IE.

window["'.$this->getJsHelperName().'"] = function(e) {
    var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
    return [window.sharedDataNamespace].concat("string" == typeof e ? e.split(".") : []).reduce(function(e, t) {
        return e === n || "object" != typeof e || void 0 === e[t] ? n : e[t]
    }, window)
}

Can I send you a pull request to make your package compatible with IE, or you want to do it yourself ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions