Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wcDocker Frame do not load URL when we use jQuery v.3.3.1 #124

Open
mzabuawala opened this issue Apr 6, 2018 · 0 comments
Open

wcDocker Frame do not load URL when we use jQuery v.3.3.1 #124

mzabuawala opened this issue Apr 6, 2018 · 0 comments

Comments

@mzabuawala
Copy link

Hello,

I trying to open a Frame with specific url but it failed with jQuery error,
Sample code: frame.openURL('about:blank');

Looking at the source we are passing url as function jQuery.fn.load = function( url, params, callback ) which was working properly in earlier version but with newer version of jQuery it is not working as they have removed the first if condition,

jQuery.fn.load = function( url, params, callback ) {
	if ( typeof url !== "string" && _load ) {                      <----------------- Not present in latest version of jQuery 3.3.1
		return _load.apply( this, arguments );
	}

Code causing issue:

        /**
         * Opens a given URL address into the iFrame.
         * @function module:wcIFrame#openURL
         * @param {String} url - The full, or relative, path to the page.
         */
        openURL: function (url) {
            this.__clearFrame();

            this.$iFrame = $('<iframe>iFrames not supported on your device!</iframe>');
            this.$frame.prepend(this.$iFrame);

            this.__onMoved();
            this._window = this.$iFrame[0].contentWindow || this.$iFrame[0];
            this.__updateFrame();
            this._window.location.replace(url);

            this.$iFrame[0].focus();
            this.$iFrame.hover(this.__onHoverEnter.bind(this), this.__onHoverExit.bind(this));

            var self = this;
            this.$iFrame.load(function () {                                      <----- HERE IS THE PROBLEM
                for (var i = 0; i < self._onLoadFuncs.length; ++i) {
                    self._onLoadFuncs[i]();
                }
                self._onLoadFuncs = [];
            });
        },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant