Connecting Tech Pros Worldwide Help | Site Map

communicate between iframes on different subdomains

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 17th, 2006, 02:05 PM
Kenny Lai
Guest
 
Posts: n/a
Default communicate between iframes on different subdomains

hey,
Is there a way to communicate between iframes on different subdomains?
e.g. from one.dot.com to two.dot.com? there is a security access
restriction passing javascript commands between subdomains that we've
run into.

-Kenny


  #2  
Old November 17th, 2006, 02:15 PM
VK
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains


Kenny Lai wrote:
Quote:
hey,
Is there a way to communicate between iframes on different subdomains?
e.g. from one.dot.com to two.dot.com?
AFAIK only for Internet Explorer. For that each envolved page
(including the one hosting iframes) has to execute JavaScript command
document.domain = "dot.com";
before the first attempt of cross-subdomain communication.

  #3  
Old November 17th, 2006, 03:25 PM
Kenny Lai
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

awesome. that will work. thanks.

-Kenny

VK wrote:
Quote:
Kenny Lai wrote:
Quote:
hey,
Is there a way to communicate between iframes on different subdomains?
e.g. from one.dot.com to two.dot.com?
>
AFAIK only for Internet Explorer. For that each envolved page
(including the one hosting iframes) has to execute JavaScript command
document.domain = "dot.com";
before the first attempt of cross-subdomain communication.
  #4  
Old November 17th, 2006, 04:55 PM
Randy Webb
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

VK said the following on 11/17/2006 10:38 AM:
Quote:
Kenny Lai wrote:
Quote:
>hey,
>Is there a way to communicate between iframes on different subdomains?
>e.g. from one.dot.com to two.dot.com?
>
AFAIK only for Internet Explorer.
That's why we don't place a whole lot of faith in what you know.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #5  
Old November 17th, 2006, 05:25 PM
VK
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

AFAIK only for Internet Explorer.
Quote:
That's why we don't place a whole lot of faith in what you know.
Please quote properly the post you are commenting on. "AFAIK..."
sentense was the beginning of the solution I proposed and w/o it the
sentense has no sense.
If you know other UA's implementing IE's document.domain mechanics that
would be helpful to know to everyone. I'm not denying the possibility
of these UA's, I simply don't know of them (AFAIK - As Far As I Know)

  #6  
Old November 17th, 2006, 08:55 PM
ASM
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

Kenny Lai a écrit :
Quote:
hey,
Is there a way to communicate between iframes on different subdomains?
e.g. from one.dot.com to two.dot.com? there is a security access
restriction passing javascript commands between subdomains that we've
run into.
dot.com/one/
dot.com/two/

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
  #7  
Old November 17th, 2006, 09:36 PM
Randy Webb
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

VK said the following on 11/17/2006 1:48 PM:
Quote:
Quote:
Quote:
>>AFAIK only for Internet Explorer.
>
Quote:
>That's why we don't place a whole lot of faith in what you know.
>
Please quote properly the post you are commenting on. "AFAIK..."
That coming from someone who can't quote me properly and give proper
attribution? Who wrote the above? Only by looking at other articles can
anybody know.

My response was directed - directly - at your "AFAIK". document.domain
is a very well known about issue in this group. A simple search for it
will lead you here:

<URL: http://www.mozilla.org/projects/security/components/same-origin.html>

So, your AFAIK doesn't mean a whole lot and leads to "why we don't place
of whole lot of faith in what you know" as your record speaks for itself.
Quote:
sentense was the beginning of the solution I proposed and w/o it the
sentense has no sense.
Sure it does, just not to you.
Quote:
If you know other UA's implementing IE's document.domain mechanics that
would be helpful to know to everyone.
See above.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
  #8  
Old November 17th, 2006, 10:05 PM
VK
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains


Randy Webb wrote:
Quote:
My response was directed - directly - at your "AFAIK". document.domain
is a very well known about issue in this group.
Sure it is: after I brought it here back in 2003 :-)
<http://groups.google.com/group/comp.lang.javascript/msg/2cadc7870c500457>
But at that time it was IE-only extension.
Quote:
>A simple search for it
will lead you here:
>
<URL: http://www.mozilla.org/projects/security/components/same-origin.html>
This is a useful link and this is really all you had to post on the
first plase instead of playing some games of a kind "I know something
cool but I will not tell anyone". For a technical newsgroup it is not
an appropriate style IMHO.

As it's listed on Mozilla Projects section, it is also would be useful
to find if it's also documented on MDC, if it was ever implemented and
if implemented then from what version.

Also if Mozilla went for adopting this IE feature then it could be
expected that some other UA did the same.

Does anyone have some comparison stidies done on document.domain
support?

  #9  
Old November 17th, 2006, 10:25 PM
Peter Michaux
Guest
 
Posts: n/a
Default Re: communicate between iframes on different subdomains

VK wrote:
Quote:
>
Does anyone have some comparison stidies done on document.domain
support?
I just put

javascript:alert(document.domain);

in the URL bar of

IE 5
IE 6
Safari 2
Opera 6
Opera 9
Netscape 6
Firefox 1.5

All these browser reported the correct domain.

I have also used document.domain to allow cross subdomain Ajax on a
site with 10,000 users and no one has complained so a variety of
popular browser can use document.domain as expected.

Peter

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.