JQuery and frames - $(document).ready doesn't work

后端 未结 12 2330
长发绾君心
长发绾君心 2020-12-14 09:51

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 fr

12条回答
  •  粉色の甜心
    2020-12-14 10:09

    If you want to fire the onload event for your frames, then follow these steps:

    1. Assign an id and name to each tag. Make sure both id and name attributes value is same.

    2. Use the following code to fire the onload event of the frame:

      $("frameName").ready(function() { 
        // Write your frame onload code here
      }
      

提交回复
热议问题