Menü schliessen
Created: August 14th 2012
Last updated: May 1st 2020
Categories: Joomla
Author: Marcus Fleuti

Joomla :: modal.js - Error in Firefox when opening a modal window - message: Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.contains]

Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

The following information was originally found here

The problem

The Joomla modal window script syntax in the file /media/system/js/modal.js produces the following error when benig displayed with Firefox:

Could not convert JavaScript argument arg 0 [nsIDOMHTMLDivElement.contains] localhost/uknowva/media/system/js/modal.js Line 220

This is a bug in the file modal.js. It was filed already here. You can do the following to get a workaround for this:

The solution

#1 uncompressed modal.js:

Search for this line in /media/system/js/modal.js (Line 220):

else if (!(content !== this.content && this.content.contains(content)))

and replace it with this:

else {this.content.adopt(content);}

#2 compressed modal.js

Search for this:

this.content.set("html",a):a!==this.content&&this.content.contains(a)||this.content.adopt(a))

and replace it with this:

this.content.set("html",a):this.content.adopt(a))