[WSG] Need to access parent content from iframe

2011-04-05 Thread Mahendran Venkatesan
Hi,

In my website, I have a requirement like the iframe js should access the
form fields of parent window. I tried with window.parent.document.forms,
but it is not working.

Is there any possibility to access the parent window content from iframe js?

p.s. The iframe and parent window are different domain. The js file resides
in iframe.

Thanks!
Venkatesan M


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

[WSG] Need to access parent content from iframe

2011-04-05 Thread Mahendran Venkatesan
In my website, I have a requirement where iframe js should access the form
fields of parent window. I tried with window.parent.document.forms, but it
is not working.

Is there any possibility to access the parent window content from iframe js?

p.s. The iframe and parent window are different domain. The js file resides
in iframe.

Thanks!
Venkatesan M


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread Elankeeran / இளங்கீரன் V
its your iframe url and parent window in same window?

On Tue, Apr 5, 2011 at 3:34 PM, Mahendran Venkatesan 
venkatesan.mahend...@gmail.com wrote:


 In my website, I have a requirement where iframe js should access the form
 fields of parent window. I tried with window.parent.document.forms, but it
 is not working.


 Is there any possibility to access the parent window content from iframe
 js?

 p.s. The iframe and parent window are different domain. The js file resides
 in iframe.

 Thanks!
 Venkatesan M


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread David Dorward
On 5 Apr 2011, at 10:52, Mahendran Venkatesan wrote:
 In my website, I have a requirement like the iframe js should access the form 
 fields of parent window. I tried with window.parent.document.forms, but it 
 is not working.
 
 Is there any possibility to access the parent window content from iframe js?
 
 p.s. The iframe and parent window are different domain. The js file resides 
 in iframe.

No. https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript

-- 
David Dorward
http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread Mahendran Venkatesan
yes!


2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

 its your iframe url and parent window in same window?

 On Tue, Apr 5, 2011 at 3:34 PM, Mahendran Venkatesan 
 venkatesan.mahend...@gmail.com wrote:


 In my website, I have a requirement where iframe js should access the form
 fields of parent window. I tried with window.parent.document.forms, but it
 is not working.


 Is there any possibility to access the parent window content from iframe
 js?

 p.s. The iframe and parent window are different domain. The js file
 resides in iframe.

 Thanks!
 Venkatesan M


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread Elankeeran / இளங்கீரன் V
if both the page are in different domain and if your owning both page then
you can add below line in the top of your both page

window.domain=yourdomainname;



On Tue, Apr 5, 2011 at 4:09 PM, Mahendran Venkatesan 
venkatesan.mahend...@gmail.com wrote:


 yes!


 2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

 its your iframe url and parent window in same window?

 On Tue, Apr 5, 2011 at 3:34 PM, Mahendran Venkatesan 
 venkatesan.mahend...@gmail.com wrote:


 In my website, I have a requirement where iframe js should access the
 form fields of parent window. I tried with window.parent.document.forms,
 but it is not working.


 Is there any possibility to access the parent window content from iframe
 js?

 p.s. The iframe and parent window are different domain. The js file
 resides in iframe.

 Thanks!
 Venkatesan M


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread Mahendran Venkatesan
hi David,

Thanks for sharing!

I thought the policy is applicable only for accessing the content from
parent window to iframe. So, the access permission in both ways is not
possible.


Regards,
Venkatesan M


On Tue, Apr 5, 2011 at 4:04 PM, David Dorward da...@dorward.me.uk wrote:

 On 5 Apr 2011, at 10:52, Mahendran Venkatesan wrote:

 In my website, I have a requirement like the iframe js should access the
 form fields of parent window. I tried with window.parent.document.forms,
 but it is not working.


 Is there any possibility to access the parent window content from iframe
 js?

 p.s. The iframe and parent window are different domain. The js file resides
 in iframe.


 No. https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript

 --
 David Dorward
 http://dorward.me.uk


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread Mahendran Venkatesan
i tried with window.domain, it's not working.


2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

 if both the page are in different domain and if your owning both page then
 you can add below line in the top of your both page

 window.domain=yourdomainname;



 On Tue, Apr 5, 2011 at 4:09 PM, Mahendran Venkatesan 
 venkatesan.mahend...@gmail.com wrote:


 yes!


 2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

 its your iframe url and parent window in same window?

 On Tue, Apr 5, 2011 at 3:34 PM, Mahendran Venkatesan 
 venkatesan.mahend...@gmail.com wrote:


 In my website, I have a requirement where iframe js should access the
 form fields of parent window. I tried with window.parent.document.forms,
 but it is not working.


 Is there any possibility to access the parent window content from iframe
 js?

 p.s. The iframe and parent window are different domain. The js file
 resides in iframe.

 Thanks!
 Venkatesan M


 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



 ***
 List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
 Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
 Help: memberh...@webstandardsgroup.org
 ***



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread David Dorward
 
On 5 Apr 2011, at 11:55, Mahendran Venkatesan wrote:
 
 I thought the policy is applicable only for accessing the content from parent 
 window to iframe. So, the access permission in both ways is not possible. 


It applies to all cross origin communication - XHR, frames, etc, etc.

-- 
David Dorward
http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


Re: [WSG] Need to access parent content from iframe

2011-04-05 Thread David Dorward
 
On 5 Apr 2011, at 11:48, Elankeeran / இளங்கீரன் V wrote:

 if both the page are in different domain and if your owning both page then 
 you can add below line in the top of your both page
 
 window.domain=yourdomainname;

From: https://developer.mozilla.org/en/document.domain

 In the DOM HTML specification, this property is listed as being read-only. 

So you shouldn't be able to do that.

 However, Mozilla will let you set it to a superdomain of the current value, 
 constrained by its base domain. For example, on developer.mozilla.org it is 
 possible to set it to mozilla.org but not mozilla.com or org.

So you can, but only in non-standard and very limited ways.

-- 
David Dorward
http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



RE: [WSG] Need to access parent content from iframe

2011-04-05 Thread Hayden O'Sullivan
You could implement this using cross-document messaging 
(http://dev.w3.org/html5/postmsg/). I'm not sure how many browsers support it 
though.

 

From: li...@webstandardsgroup.org [mailto:li...@webstandardsgroup.org] On 
Behalf Of Mahendran Venkatesan
Sent: Tuesday, 5 April 2011 8:58 PM
To: wsg@webstandardsgroup.org
Subject: Re: [WSG] Need to access parent content from iframe

 


i tried with window.domain, it's not working.



2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

if both the page are in different domain and if your owning both page then you 
can add below line in the top of your both page

window.domain=yourdomainname;




On Tue, Apr 5, 2011 at 4:09 PM, Mahendran Venkatesan 
venkatesan.mahend...@gmail.com wrote:


yes!



2011/4/5 Elankeeran / இளங்கீரன் V ekee...@gmail.com

its your iframe url and parent window in same window?

On Tue, Apr 5, 2011 at 3:34 PM, Mahendran Venkatesan 
venkatesan.mahend...@gmail.com wrote:

 

In my website, I have a requirement where iframe js should access the form 
fields of parent window. I tried with window.parent.document.forms, but it is 
not working.



Is there any possibility to access the parent window content from iframe js?

p.s. The iframe and parent window are different domain. The js file resides in 
iframe.

Thanks!
Venkatesan M

 

***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
*** 



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***