Skip to content

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

@mzabuawala

Description

@mzabuawala

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 = [];
            });
        },

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