Error closing iframe in IE

Creating a site that has videos that are inside the iframe opens with Highslide. Everything works fine except for IE. When I close Highslide (and delete the Iframe inside), I get these error messages:

SCRIPT5007: Unable to get property 'random' of undefined or null reference
File: jquery.min.js, Line: 2, Column: 1711

SCRIPT5009: 'jQuery' is undefined
File: flowplayer.min.js, Line: 6, Column: 1

SCRIPT5009: 'flowplayer' is undefined
File: index.php, Line: 20, Column: 4

Sometimes I get a repeating error:

SCRIPT445: Object doesn't support this action
File: jquery.min.js, Line: 2, Column: 4058

If I open the same Highslide Iframe again immediately after an error occurs, it will open just fine, without any problems, but still have errors when closing. I am honestly shocked at what to do to fix this.

+4
source share
2 answers

, IE. , iframe , , , iframe , - , Object Math, .

, iframe, , , , , .

, - IE jQuery (1.11.0), , . , iframe, DOM:

                // Instead of:
                //$('div').empty();

                // Run this:
                var div = $('div')[0];
                while (div.firstChild) {
                    div.removeChild(div.firstChild);
                }

, , , ( , ), IE, -, , , .:)

+2

highslide-full.js ( 4.1.12) afterClose (- 2926) :

if (this.outline && this.outlineWhileAnimating) this.outline.destroy();

:

if (this.iframe) {
  this.body.removeChild(this.iframe);
}

IE9 .

0

Source: https://habr.com/ru/post/1544525/


All Articles