Hi Robsan

I has a similar problem a while ago, just a few tips, and I am not
stating that this will fix the problem,
* make sure your iframe has an id attribute
* ensure the iframe and parent document has a valid doctype

Also, i am using this function to get an iframe document. it works
cross browser:

function getIFrameDocument(iframe) {
    var doc;
    if (iframe.contentDocument) {
        doc = iframe.contentDocument;
    } else if (iframe.contentWindow) {
        doc = iframe.contentWindow.document;
    } else if (iframe.document) {
        doc = iframe.document;
    } else {
        doc = window.frames[iframe.id].document;
    }

    return doc;
}

and this function retrieves elements in the frame based on their id:

/**
 * helper function similair to $ for getting elements
 * by id in the specified frame
 */
function $IF(frame, el) {
    var element;
    var iframe = $(frame);
    if (iframe) {
        var doc = getIFrameDocument(iframe);
        if (doc) {
            if (Object.isString(el))
                el = doc.getElementById(el);
            if (el) {
                element = Element.extend(el);
            }
        }
    }

    return element;
}

Hope this helps, please let us know.

On Apr 5, 8:02 am, robsan <[email protected]> wrote:
> really cant get it to work. Tried everything 
> athttp://www.dyn-web.com/tutorials/iframes/
> but all i can print is the main window, not the frame. would really
> appriciate help with this one.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to