Ok, I am realizing it has to do with the do with the $(document).ready function. If I just use:
$ = window.parent.$; $("#hold").append('<a href="#">Inserted from iFrame</a> <br />'); In the iframe, it correctly adds the link to the parent, and it gets the event from livequery! Hooray!! But, obviously I need to add back a document ready function so that I can bind events within the iframe. How does that need to be done in this context? As I said, using the normal document ready does not work. On Sep 17, 9:58 am, ricardobeat <[EMAIL PROTECTED]> wrote: > using the iframe's jQuery object: > > $('.classinparentframe', parent.window.document) > > Ideally if the contents of the iframe are always known to you, you > should use only one instance of jQuery on the parent window and do all > your stuff from it, it's simpler to debug also. > > On Sep 16, 10:29 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > Thanks Ricardo. > > > But what if I wanted to access the parent document from WITHIN the > > iframe? > > > On Sep 16, 12:27 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > You need to understand that a frame is another 'window' instance, it > > > doesn't have the same jQuery object as the parent window unless you > > > tell it to. So the '$' object you use in firebug console is always the > > > one from the parent window. > > > > If i'm not mistaken you can acess frame content with the parent > > > window's jQuery object using $('.classinsidetheframe', > > > frames['name'].document).css(); > > > > On Sep 16, 1:48 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > Ok Brandon, > > > > > I found this in another post: > > > > > var doc = $('#testframe')[0].contentWindow.document; > > > > $(doc.body).append('<span>test</span>'); > > > > > This seems like it would help, but I am not sure how to use this, > > > > along with what you posted to get it working correctly. Somehow > > > > sending the GET within the context of the contentWindow is confusing > > > > me, and I just can't get it working. > > > > > On Sep 15, 9:18 am, "Brandon Aaron" <[EMAIL PROTECTED]> wrote: > > > > > > To see what I mean run this in Firebug: > > > > > $('iframe')[0].contentWindow.$ = $; > > > > > > Then click on the link in the iframe and it will behave as you expect. > > > > > > -- > > > > > Brandon Aaron > > > > > > On Mon, Sep 15, 2008 at 9:13 AM, Brandon Aaron <[EMAIL > > > > > PROTECTED]>wrote: > > > > > > > This would work if you used the frames parent instance of jQuery. > > > > > > LiveQuery > > > > > > works by monitoring the DOM methods within jQuery. Since within the > > > > > > frame > > > > > > you are using a new instance of jQuery, LiveQuery will not be > > > > > > monitoring its > > > > > > DOM methods. > > > > > > -- > > > > > > Brandon Aaron > > > > > > > On Sun, Sep 14, 2008 at 11:04 PM, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > >> I can confirm that using event delegation will fix this problem. I > > > > > >> guess that it is just a problem with the LiveQuery plugin. > > > > > >> Brandon, > > > > > >> if you are where around here, could you comment on this? > > > > > > >> Thanks. > > > > > > >> On Sep 14, 2:29 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > >> > I have a working example of this, and would really like help > > > > > >> > understanding why bind or livequery does not bind events to DOM > > > > > >> > elements that are inserted from an iframe. > > > > > > >> >http://web2.puc.edu/PUC/files/bind.html > > > > > > >> > Clicking the "insert from frame" link will append links to the > > > > > >> > parent > > > > > >> > frame, which won't pick up the click event. But, clicking the > > > > > >> > "insert > > > > > >> > from body" link will append links within the same frame and will > > > > > >> > correctly have the click events bound. > > > > > > >> > Why is this happening? > > > > > > >> > On Sep 12, 9:02 pm, hubbs <[EMAIL PROTECTED]> wrote: > > > > > > >> > > I have been experiencing strangeness with trying tobindevents > > > > > >> > > to DOM > > > > > >> > > elements that have been inserted from a different frame using > > > > > >> > > .get(). > > > > > >> > > For some reason the elements don't be binded with the events > > > > > >> > > if they > > > > > >> > > are inserted from other frame. In testing, if I try the same > > > > > >> thingwithinthe SAME frame the the events get binded correctly. > > > > > > >> > > Am I missing something here? Is this a limitation of jQuery?