JQuery and frames – $(document).ready doesn’t work

Spread the love

Question Description

I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a frame, $(document).ready() doesn’t fire up.

My frameset looks like:


My page is loaded into the main frame. What should I do?

Practice As Follows

I have tried the method mentioned in another comment:

$("#frameName").ready(function() {
    // Write you frame on load javascript code here
} );

and it did not work for me.

this did:

$("#frameName").load( function() {
     //code goes here
} );

Even though the event does not fire as quickly – it waits until images and css have loaded also.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.