Skip to content

new Element forbidden for IE!! #2211

ibolmo opened this Issue Jan 19, 2012 · 1 comment

1 participant

MooTools member
ibolmo commented Jan 19, 2012

(from Lighthouse)

To have mootools compatible, when more documents are involved, they are severals catch in current master.

Explanation: if element is created by new Element, its .ownerDocument is top document. If such element is injected in to another document, IE will alert some ugly error.

Bugs and fixed:

iframe = new Element(iframe || 'iframe', props);

IFrame should have additional option: document, and iframe creating should be:

iframe = this.options.document.newElement(iframe || 'iframe', props);

element set html

var first = new Element('div'); 

should be:

var first = this.getDocument.newElement('div');

Swiff, RequestHTML, Tips and Assets - also should have option document


this.wrapper = wrapper || new Element('div', {

should be:

this.wrapper = wrapper || this.element.getDocument().newElement('div', {

Sortables should also retrieve document from lists.

(from comment)

Rule 1)
Where ever you use new Element, which will be injected in some existing element, then zou have to retrieve right document: iamPlaceholder.getDocument().newElement

Rule 2)
Where ever you have to create new Element, and you don't know, where is be placed, then you have to add to you class overidable option {document:document}

MooTools member
ibolmo commented Jul 3, 2014

Closing due to lack of update/interest.

@ibolmo ibolmo closed this Jul 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.