Run JQuery in the context of another frame

后端 未结 4 1326
孤独总比滥情好
孤独总比滥情好 2020-11-27 04:09

The client I am working with has a frameset like so...


  

        
4条回答
  •  爱一瞬间的悲伤
    2020-11-27 04:41

    I'm not certain about the block plugin, but can't you get hold of the relevant frame and manipulate it using the "frame tree", something like this: (from within importantFrame.htm)

    parent.theFrame.someProperty = someValue;
    

    eg:

    parent.theFrame.location.href='anotherPage.html';
    

    From what I've been reading, you might need Jquery on the target page, but you could try something like:

    parent.theFrame.block();
    

    or maybe:

    $('#theFrame').block();
    

提交回复
热议问题