1

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

2
  • if you explain what this jQuery magic is and how frames are preventing you from doing this, someone might be able to answer your question Commented Apr 16, 2009 at 0:16
  • Shard is right - need some more information on this Commented Apr 16, 2009 at 0:36

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.