[jQuery] Re: Very disappointed with jquery and iframe communication
You can also access the frame's contents via $('#frame_id').contents ().find('xx'), I think. On Sep 15, 9:42 am, Paolo Chiodi wrote: > Of course it doesn't work. > You are searching for node elements with id=login that are child of > your iframes. You need to use the dom of the page loaded inside the i > frame > try $(frames['Theiframe']).get(0).contentDocument > > I in the content page is present jquery, use > $(frames['Theiframe']).get(0).contentWindow.$('#login') > > BTW, you can access child dom only if in same domain > > Paolo > > > > On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > > After 1 day googling and trying I find no agreement in a solid method for > > comunicating with iframe, this is the nearest point I've been to get in > > touch with IFRAME: > > > $(frames['Theiframe']).ready( function () > > { > > alert('Frame is loaded'); > > > }); > > > This will alert the message, but any attempt to comunicate with the iframe > > and access it's contents have been useless, I have a hidden field with with > > ID "login" and I'm trying to get it's value: > > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > > /// > > // > > > var $currentIFrame = $(frames['Theiframe']); > > $currentIFrame.contents().find("body #login").val() //Neither does in FF > > 3.0.14 > > > If you Google a few you will see that everyone is giving it's own opinion > > on how to do it, but there's no agreement and no crossbrowser solid > > solution...
[jQuery] Re: Very disappointed with jquery and iframe communication
this should work: $(frames['Theiframe']).attr('src', new_page_url); On Tue, Sep 15, 2009 at 4:45 PM, ximo wallas wrote: > > How can I tell to the iframe to load() a different content from the main > document? > > --- On Tue, 9/15/09, Paolo Chiodi wrote: > > From: Paolo Chiodi > Subject: [jQuery] Re: Very disappointed with jquery and iframe communication > To: jquery-en@googlegroups.com > Date: Tuesday, September 15, 2009, 1:42 PM > > > Of course it doesn't work. > You are searching for node elements with id=login that are child of > your iframes. You need to use the dom of the page loaded inside the i > frame > try $(frames['Theiframe']).get(0).contentDocument > > I in the content page is present jquery, use > $(frames['Theiframe']).get(0).contentWindow.$('#login') > > BTW, you can access child dom only if in same domain > > Paolo > > On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > > > After 1 day googling and trying I find no agreement in a solid method for > > comunicating with iframe, this is the nearest point I've been to get in > > touch with IFRAME: > > > > $(frames['Theiframe']).ready( function () > > { > > alert('Frame is loaded'); > > > > }); > > > > This will alert the message, but any attempt to comunicate with the iframe > > and access it's contents have been useless, I have a hidden field with with > > ID "login" and I'm trying to get it's value: > > > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > > > / > > > > var $currentIFrame = $(frames['Theiframe']); > > $currentIFrame.contents().find("body #login").val() //Neither does in FF > > 3.0.14 > > > > If you Google a few you will see that everyone is giving it's own opinion > > on how to do it, but there's no agreement and no crossbrowser solid > > solution... > > > > >
[jQuery] Re: Very disappointed with jquery and iframe communication
How can I tell to the iframe to load() a different content from the main document? --- On Tue, 9/15/09, Paolo Chiodi wrote: From: Paolo Chiodi Subject: [jQuery] Re: Very disappointed with jquery and iframe communication To: jquery-en@googlegroups.com Date: Tuesday, September 15, 2009, 1:42 PM Of course it doesn't work. You are searching for node elements with id=login that are child of your iframes. You need to use the dom of the page loaded inside the i frame try $(frames['Theiframe']).get(0).contentDocument I in the content page is present jquery, use $(frames['Theiframe']).get(0).contentWindow.$('#login') BTW, you can access child dom only if in same domain Paolo On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > After 1 day googling and trying I find no agreement in a solid method for > comunicating with iframe, this is the nearest point I've been to get in touch > with IFRAME: > > $(frames['Theiframe']).ready( function () > { > alert('Frame is loaded'); > > }); > > This will alert the message, but any attempt to comunicate with the iframe > and access it's contents have been useless, I have a hidden field with with > ID "login" and I'm trying to get it's value: > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > / > > var $currentIFrame = $(frames['Theiframe']); > $currentIFrame.contents().find("body #login").val() //Neither does in FF > 3.0.14 > > If you Google a few you will see that everyone is giving it's own opinion on > how to do it, but there's no agreement and no crossbrowser solid solution... > >
[jQuery] Re: Very disappointed with jquery and iframe communication
It is firing the alert, you think it is not? How can I access it and have some control over?
[jQuery] Re: Very disappointed with jquery and iframe communication
Of course it doesn't work. You are searching for node elements with id=login that are child of your iframes. You need to use the dom of the page loaded inside the i frame try $(frames['Theiframe']).get(0).contentDocument I in the content page is present jquery, use $(frames['Theiframe']).get(0).contentWindow.$('#login') BTW, you can access child dom only if in same domain Paolo On Tue, Sep 15, 2009 at 10:53 AM, ximo wallas wrote: > > After 1 day googling and trying I find no agreement in a solid method for > comunicating with iframe, this is the nearest point I've been to get in touch > with IFRAME: > > $(frames['Theiframe']).ready( function () > { > alert('Frame is loaded'); > > }); > > This will alert the message, but any attempt to comunicate with the iframe > and access it's contents have been useless, I have a hidden field with with > ID "login" and I'm trying to get it's value: > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > / > > var $currentIFrame = $(frames['Theiframe']); > $currentIFrame.contents().find("body #login").val() //Neither does in FF > 3.0.14 > > If you Google a few you will see that everyone is giving it's own opinion on > how to do it, but there's no agreement and no crossbrowser solid solution... > >
[jQuery] Re: Very disappointed with jquery and iframe communication
Are you sure that $(frames['Theiframe']) is returning the iframe ? On Tue, Sep 15, 2009 at 05:53, ximo wallas wrote: > After 1 day googling and trying I find no agreement in a solid method for > comunicating with iframe, this is the nearest point I've been to get in > touch with IFRAME: > > $(frames['Theiframe']).ready( function () > { > alert('Frame is loaded'); > > }); > > This will alert the message, but any attempt to comunicate with the iframe > and access it's contents have been useless, I have a hidden field with with > ID "login" and I'm trying to get it's value: > > $(frames['Theiframe']).find("#login").val(); //Doesn't work in FF 3.0.14 > > > / > > var $currentIFrame = $(frames['Theiframe']); > $currentIFrame.contents().find("body #login").val() //Neither does in FF > 3.0.14 > > If you Google a few you will see that everyone is giving it's own opinion > on how to do it, but there's no agreement and no crossbrowser solid > solution... > > >