Skip to content

Dear Internet Explorer user: Your browser is no longer supported

Please switch to a modern browser such as Microsoft Edge, Mozilla Firefox or Google Chrome to view this website's content.

Getting jQuery Media Plugin to work in IE9

Instructions for getting the jQuery Media Plugin (jquery.media.js) to work in Internet Explorer 9 (IE9)

The jQuery Media Plugin from Malsup.com is an excellent utility for easily inserting embedded media into a website whilst keeping the code W3C standards-compliant. It works by unobtrusively converting standard markup into rich media content. I have used it for several years and it’s excellent.

Whilst the jQuery Media Plugin works seamlessly in Firefox, Chrome, Safari and Internet Explorer 8, previous versions of this code don’t work in Internet Explorer 9 except when viewed in quirks mode.

This is very easy to fix, and requires the substitution of two lines of code within jquery.media.js.

Foe the first change, you will need to replace this:

else if ($.browser.msie) {

with this:

else if (($.browser.msie) && ($.browser.version < 9)){

Foe the second change, you will need to replace this:

($.browser.msie || player == 'iframe') ? $div.append(o) : $div.html(a.join(''));

with this:

(($.browser.msie && $.browser.version < 9 )|| player == 'iframe') ? $div.append(o) : $div.html(a.join(''));

Effective changes seem to have been incorporated into the base JavaScript code on the Github and Malsup download sites, so an update of the script on your website is preferable to amending old code.

   

Comments

3 responses to “Getting jQuery Media Plugin to work in IE9”

On 27 March 2012, pmcnally wrote: Hyperlink chain icon

THanks, worked a treat!

Reply

On 16 April 2013, Parkash Kumar wrote: Hyperlink chain icon

I have also made the above changes in jquery media file, but they are not effective enough.

Still throwing an error:

SCRIPT438: Object doesn’t support property or method ‘getElementByTagName’
jquery-1.7.1.min.js, line 16 character 59007

Please help!

Reply

On 7 May 2013, Li wrote: Hyperlink chain icon

Worked like a chime, thanks very much!

Reply

Have Your Say

The following HTML is permitted:
<a href="" title=""> <b> <blockquote cite=""> <code> <em> <i> <q cite=""> <strike> <strong>

Comments will be published subject to the Editorial Policy.