I was getting an error thrown from my iframe code and made a minor
modification to the mootools js to correct it.  Below I am pasting the
IFrame native with one line commented out.  If I uncomment that line
it throws an error for me every time.


var IFrame = new Native({

        name: 'IFrame',

        generics: false,

        initialize: function(){
                var params = Array.link(arguments, {properties: Object.type, 
iframe:
$defined});
                var props = params.properties || {};
                var iframe = $(params.iframe) || false;
                var onload = props.onload || $empty;
                delete props.onload;
                props.id = props.name = $pick(props.id, props.name, iframe.id,
iframe.name, 'IFrame_' + $time());
                iframe = new Element(iframe || 'iframe', props);
                var onFrameLoad = function(){
                        var host = $try(function(){
                                return iframe.contentWindow.location.host;
                        });
                        if (host && host == window.location.host){
                                var win = new Window(iframe.contentWindow);
                                var doc = new 
Document(iframe.contentWindow.document);
                                $extend(win.Element.prototype, 
Element.Prototype);
                        }
                        //onload.call(iframe.contentWindow, 
iframe.contentWindow.document);
                };
                (!window.frames[props.id]) ? iframe.addListener('load',
onFrameLoad) : onFrameLoad();
                return iframe;
        }

});


Should that call have been contained within the if statement above it?

Reply via email to