views:

774

answers:

2

I am currently working on a web application that has been created using a magnitude of frames that stretch down up to 5 times, The issue is that i need to preform some jquery magic throughout the website.

What would be the best way to go about this (other than rewriting it which i have considered)?

EDIT:

The Frame Structure is something along the lines of this:

Index.html
    menu.html
        banner.html
        list.html
        footer.html
    /lib/index.html
        header.html
        body.html
        footer.html

The magic i am referencing is a few hot key shortcuts, find and replace that kind of stuff

+3  A: 

This is what you want:

$.frameReady()

frameReady lets you run jQuery commands in a target frame as if it were in the local document. It works much like the $(document).ready() function, waiting until the DOM is ready in the target frame before attempting to run your code. It will also load jQuery in the target frame for you if it doesn’t already exist and allows you to load other script files and stylesheets easily. frameReady supports nested frames and iframes in any combination, even dynamically created frames.

altCognito
Does this do the trick?
altCognito
A: 

You can also use the jQuery below to target elements and content in iFrames.

$('#iframeId').load(function(){
    $(this.contentDocument).find('#id').html('your text');
});
Nick Lowman