Re: [jQuery] $() Iframes

2006-08-25 Thread 刘远志
I found out how to do the iframe inside ouside inter-access. And I wrote some test code in the traditional js way(tested with IE, Firefox). I've tried to write these code using jquery, but not success yet. the main page code
1html
2head
3
titleMAIN/title
4
scripttype=text/_javascript_
5 //
主页面访问IFrame页面DOM内容6
functionoinit(){7alert(getIFrameDoc(
iframe1).getElementById(
idiv).id);8}
9functiongetIFrameDoc(id){10
variframe=
document.getElementById(id);11var
doc=(iframe.contentWindow||iframe.contentDocument
);12if(doc.document){
13doc=doc.document;
14}15return
doc;16}17
/script
18/head
19bodyonload
=oinit()
20divid
=odiv
21iframeid
=iframe1src
=iframe.html/
iframe22
/div23
/body
24/html// the iframe page code
1html
2head
3
titleIFRAME/title
4
scripttype=text/_javascript_
5 //
IFrame页面访问外层页面DOM内容6
functioniinit(){7alert(window.parent.document.getElementById(
odiv).id);8
}9/script
10/
head11
bodyonload=iinit()
12
divid=idiv
13
/body14
/html
On 8/25/06, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:I have a scenario where I am trying to get to a div located within an
iframe from the parent using the jQuery $() selector. I have triedmultiple things but seem to have no luck. I was wondering if anyonehad some suggestions or some past issues with this.Thanks in advance,
Jeff___jQuery mailing listdiscuss@jquery.comhttp://jquery.com/discuss/
-- 刘远志QQ:2065254
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] $() Iframes

2006-08-24 Thread developer
I have a scenario where I am trying to get to a div located within an  
iframe from the parent using the jQuery $() selector. I have tried  
multiple things but seem to have no luck. I was wondering if anyone  
had some suggestions or some past issues with this.

Thanks in advance,
Jeff



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $() Iframes

2006-08-24 Thread Blair McKenzie
I've tried that before, and I ended up linking to jquery in the iframe page and using iframeobject.$().On 8/25/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I have a scenario where I am trying to get to a div located within aniframe from the parent using the jQuery $() selector. I have triedmultiple things but seem to have no luck. I was wondering if anyonehad some suggestions or some past issues with this.
Thanks in advance,Jeff___jQuery mailing listdiscuss@jquery.com
http://jquery.com/discuss/
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] $() Iframes

2006-08-24 Thread developer
I understand that from within the iframe, I could do a  
window.parent.$('#MyDivInsideIframe')
to use the jquery loaded in the parent to manipulate the div in the iframe.

However, I want to manipulate '#MyDivInsideIframe' from the parent.

When you suggest iframeobject, is that browser dependent? Or do you  
mean from the parent, using something like

self.MyIFrame.$('#MyDivInsideIframe')

In that case, wouldn't that require jquery to be loaded in the iframe  
also? Can that be avoided?

Thanks again for your help!
Quoting Blair McKenzie [EMAIL PROTECTED]:

 I've tried that before, and I ended up linking to jquery in the iframe page
 and using iframeobject.$().

 On 8/25/06, [EMAIL PROTECTED] 
 [EMAIL PROTECTED] wrote:

 I have a scenario where I am trying to get to a div located within an
 iframe from the parent using the jQuery $() selector. I have tried
 multiple things but seem to have no luck. I was wondering if anyone
 had some suggestions or some past issues with this.

 Thanks in advance,
 Jeff



 ___
 jQuery mailing list
 discuss@jquery.com
 http://jquery.com/discuss/




___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/