473,654 Members | 3,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross Domain Scripting with Friendly Domains

Having read the CLJ FAQ and having done extensive Googling, I do
understand that in in general cross-domain iframe scripting is not
permitted. One issue I have not seen directly addressed, however, is
scripting across different but still "friendly" domains.

Essentially I'd like to send a signal from the child to the parent in
any form at all. I would think that there might exist a way to set some
variable or object property that could both be read by the parent and
written to by the child (or vice versa).

Am I just totally wrong?
Thanks,
Jacob.

Aug 11 '06 #1
4 2157
Jacob JKW said the following on 8/10/2006 8:27 PM:
Having read the CLJ FAQ and having done extensive Googling, I do
understand that in in general cross-domain iframe scripting is not
permitted. One issue I have not seen directly addressed, however, is
scripting across different but still "friendly" domains.
Yes, and those "friendly" domains are in your "Trusted Sites" list in IE.
Essentially I'd like to send a signal from the child to the parent in
any form at all. I would think that there might exist a way to set some
variable or object property that could both be read by the parent and
written to by the child (or vice versa).
Check into the Trusted Sites. That's for your browser. If you are
hunting some way to send a "signal" from two different domains in a
user's browser, give it up.
Am I just totally wrong?
That depends on what you think and what you are trying to do.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 11 '06 #2

"Jacob JKW" <ja******@yahoo .comwrote in message
news:11******** *************@7 5g2000cwc.googl egroups.com...
Having read the CLJ FAQ and having done extensive Googling, I do
understand that in in general cross-domain iframe scripting is not
permitted. One issue I have not seen directly addressed, however, is
scripting across different but still "friendly" domains.

Essentially I'd like to send a signal from the child to the parent in
any form at all. I would think that there might exist a way to set some
variable or object property that could both be read by the parent and
written to by the child (or vice versa).

Am I just totally wrong?
I've often thought there _should_ be a system for this - some extension the
browser object model that provided for a "public" scope which which you
could store information visible to anybody. But there isn't.

I once played extensively with this. The most successful failure I had
dealt with setting asynchronous messages in the status bar in one frame and
reading them in another. It worked, mostly, but not in all browsers (if I
remember correctly at the time it worked in IE 4, 5 and 6 on Windows and
Mozilla... but oddly enough not on IE 5.5 - or something like that).

Even if it did work across all browsers it would almost definately have been
seen as a security bug and fixed to eliminate the (already very tenuous)
connection.

One thing you can do is consume script from another site. Although the
script itself is then considered "local" (it's run with the same privledges
as if it were loaded from the containing page's server) it can, of course,
contain "special" information from the other server.

We use this, as an example, in a site were the "main site" frames some
information from an affiliated site. The main site has left-hand navigation
and a bread-crumb trail that the affiliated site needs to mimic. So we've
encapsulated all of the code for those into a JS file: both sites call the
same file and can display any state of the navigation. The main site passed
query-string parameters to the affiliate site when it's called to let it
know the state of the navigation so that the two match.

Although in reality there are two sets of navigation (one per site) it
_looks_ like one set, one site, and we only have to maintain one file with
the information.

If you set cookie or query-string variables on the call to the script itself
you can pass information to the other server (although this would have to be
dealt with by a server-side component, not client-side javascript which
wouldn't have access). But simple server-side script could inteperate the
information and dynamically generate the client-side script (this is, in
fact, what's done by many banner-ad aggregators).

An image call (for example) could also be used to send such information to
another server.

The server would stow the information someplace which could be retrieved by
the client-side script in the other frame. In this way (badly explained I
know) the two sets of client-side scripts, separated on the client-side,
could use a server-side conduit to "talk". It's ugly and slow and messy but
it would work.

But as far as real client-side communication.. . I doubt you'll see one.
Even if you do find a hack don't expect it to stay available. ;^)

Jim Davis
Aug 13 '06 #3

Jim Davis wrote:
"Jacob JKW" <ja******@yahoo .comwrote in message
news:11******** *************@7 5g2000cwc.googl egroups.com...
Having read the CLJ FAQ and having done extensive Googling, I do
understand that in in general cross-domain iframe scripting is not
permitted. One issue I have not seen directly addressed, however, is
scripting across different but still "friendly" domains.

Essentially I'd like to send a signal from the child to the parent in
any form at all. I would think that there might exist a way to set some
variable or object property that could both be read by the parent and
written to by the child (or vice versa).

Am I just totally wrong?

I've often thought there _should_ be a system for this - some extension the
browser object model that provided for a "public" scope which which you
could store information visible to anybody. But there isn't.

Even if it did work across all browsers it would almost definately have been
seen as a security bug and fixed to eliminate the (already very tenuous)
connection.

One thing you can do is consume script from another site. Although the
script itself is then considered "local" (it's run with the same privledges
as if it were loaded from the containing page's server) it can, of course,
contain "special" information from the other server.
I actually just found this site:
http://eng.professionalconsulting.ru/lab/ajaxextended/ and thought it
extremely cool.

Aug 13 '06 #4


Jacob JKW wrote:
Having read the CLJ FAQ and having done extensive Googling, I do
understand that in in general cross-domain iframe scripting is not
permitted. One issue I have not seen directly addressed, however, is
scripting across different but still "friendly" domains.

Essentially I'd like to send a signal from the child to the parent in
any form at all. I would think that there might exist a way to set some
variable or object property that could both be read by the parent and
written to by the child (or vice versa).
Opera 8 and 9 has support for this API
<http://www.whatwg.org/specs/web-apps/current-work/#crossDocumentM essages>
here is a simple example
<http://home.arcor.de/martin.honnen/javascript/2006/08/test2006081301. html>
using that API to send a message with script in a document on
home.arcor.de to the document in the iframe which sits on
www34.brinkster .com.

The upcoming Firefox 2.0 will support this API
<http://www.whatwg.org/specs/web-apps/current-work/#scs-client-side>
that exposes a global storage based on domain parts.
Of course none of that currently helps far on the web if you expect
visitors with all sorts of browsers.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8439
by: Angus SC2 | last post by:
Hi I am trying to set up cross domain cookies on a server I have running that currently has 2 domains running on it (on different IPs). Basically I have a forums site (using UBB threads) and I want to users to be able to use the forum login and password from the main site and then if they go to the forum site they are already logged in to that as well. I have tried followed this article:...
6
4359
by: Charles Crume | last post by:
Hello; My index.htm page (www.charlescrumesoftware.com for those interested in looking) contains 3 frames (left = content, top right = logo, bottom right = navigation). This domain name is registered with www.mydomain.com and is stealth forwarded to www.ccthecomputerguy.com (where my *real* web site currently lives). FWIW, I do this because in the 8+ years I've been on the web, I've changed ISPs about 5 times and every change requires a...
2
1868
by: KZSteele | last post by:
hello - i am using VBA within a microsoft access project to automate internet explorer. what i am doing is reading data from various frames in the IE window and loading them into a table. however, this cross-frame scripting security with IE is really getting on my nerves. i can't even use VB to navigate to frames located on a different domain. the page in question uses framesets, not iframes. question: how can i DISABLE the horrid...
0
1230
by: KZSteele | last post by:
(repost/edit from html forum) hello - i am using VBA within a microsoft access project to automate internet explorer. what i am doing is reading data from various frames of my company's web site (non-intranet) and loading it into a table. however, this cross-frame scripting security with IE is getting in the way. i can't even use VB to navigate to frames located on a different domain. the website in question uses framesets, not iframes. ...
0
1267
by: KZSteele | last post by:
(repost/edit from html forum) hello - i am using VBA within a microsoft access project to automate internet explorer. what i am doing is reading data from various frames of my company's web site (non-intranet) and loading it into a table. however, this cross-frame scripting security with IE is getting in the way. i can't even use VB to navigate to frames located on a different domain. the website in question uses framesets, not iframes. ...
6
5476
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or suggestions are welcome. --
16
2972
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but something that PHP guys would know the answer to. I can't think of a more appropriate forum to try. I've heard the ASP and JSP guys aren't as friendly ;-) Let's say we have a HTML page from domain example.com, and that HTML page makes a request to...
6
3976
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4293
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.