javascript - Extending Element in MooTools gives error "Uncaught TypeError: Cannot call method 'set' of null" -
i have simple mootools script:
var myelement = new class({ extends: element }); which gives error: uncaught typeerror: cannot call method 'set' of null
i'm using mootools 1.4.5, full without compatability.
if change class extends other class, works fine.
what's going on here? bug?
edit:
same thing happens implements: element!
as pointed out on page:
element not extendable not real class.
this because interface wrapper ('proxy') around browser's native internal classes wrapping 'real' elements. there 'workaround' though toelement function. if implement on object or class, passing class $ function automatically invoke it, such making class behave element, , allowing use aggregation instead of (faulty!) inheritance wrap browser elements.
Comments
Post a Comment