473,721 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cross Domain scripting error??

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 new domain
(or problems transferring) and new email addresses requiring boatloads of
people to be notified. This way I have permanent web and e-mail addresses
even though I might change ISP's every six months. Anyway...

I am learning javascript and came up with an idea to adjust the sizes of the
frames primarily as a learning exercise, but also to do something useful --
a visual effect when my page starts. I've gotten everything to work on my
local machine (Win 98se and IE6) and when run directly from my *real* web
site www.ccthecomputerguy.com/index2.htm (I'm using "index2" for testing
purposes).

However, when I access the site from
www.charlescrumesoftware.com/index2.htm, I get "Error: top.frames.xxx is nil
or not an object" (at one time I was getting "Error: Access Denied" -- which
lead me to research cross domain issues on google).

However, now I'm not sure what the problem is or if there is really a "cross
domain" problem. I pretty sure the problem javascript statement is (I can
post more code if needed):

setTimeout("top .frames['xxx'].cols =" + new_params, i*delay_multipl ier);

Can anyone help me out, provide some pointers/workarounds, or where to look
for more infomation?

TIA.

Charles...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.682 / Virus Database: 444 - Release Date: 5/11/04
Jul 23 '05 #1
6 4362
In article <gc************ ****@fe1.columb us.rr.com>, Charles Crume
says...
However, now I'm not sure what the problem is or if there is really a "cross
domain" problem. I pretty sure the problem javascript statement is (I can
post more code if needed):

setTimeout("top .frames['xxx'].cols =" + new_params, i*delay_multipl ier);

Can anyone help me out, provide some pointers/workarounds, or where to look
for more infomation?


If top.frame is from a different domain, you can't set variables in it.

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 23 '05 #2
Hi Hywel;

"Hywel" <hy**********@h otmail.com> wrote in message
news:MP******** *************** *@news.individu al.net...
In article <gc************ ****@fe1.columb us.rr.com>, Charles Crume
says...
However, now I'm not sure what the problem is or if there is really a "cross domain" problem. I pretty sure the problem javascript statement is (I can post more code if needed):

setTimeout("top .frames['xxx'].cols =" + new_params, i*delay_multipl ier);
Can anyone help me out, provide some pointers/workarounds, or where to look for more infomation?


If top.frame is from a different domain, you can't set variables in it.


Right, I know this, but the error message is pretty vague (for us javascript
newbies). I'm understanding most of the stuff people tell me and the stuff I
read -- but having a some difficulty in retaining it all in my head and
keeping it straight. So, if you can bear with me...

As I understand it your pretty much telling me I've got a cross domain
problem because, when www.charlescrumesoftware.com/index2.htm loads the
frames, the frame content comes from page on www.ccthecomputerguy.com and as
this is a different domain I cannot alter the frame contents. Am I correct
so far?

I've read about the document.domain property, and my understanding is that
it only work for the same domain suffix (which is not my case).

Could the initial index2.htm page load a page from www.ccthecomputerguy.com
which could then load the frames and avoid this problem?

TIA.

Charles...

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 5/12/04
Jul 23 '05 #3
In article <Gl************ ***@fe1.columbu s.rr.com>, Charles Crume
says...
Hi Hywel;

"Hywel" <hy**********@h otmail.com> wrote in message
news:MP******** *************** *@news.individu al.net...
In article <gc************ ****@fe1.columb us.rr.com>, Charles Crume
says...
However, now I'm not sure what the problem is or if there is really a "cross domain" problem. I pretty sure the problem javascript statement is (I can post more code if needed):

setTimeout("top .frames['xxx'].cols =" + new_params, i*delay_multipl ier);
Can anyone help me out, provide some pointers/workarounds, or where to look for more infomation?
If top.frame is from a different domain, you can't set variables in it.


Right, I know this, but the error message is pretty vague (for us javascript
newbies).


Is it? It's telling you that access to the variable you're after is
denied. That's pretty much it.

As I understand it your pretty much telling me I've got a cross domain
problem because, when www.charlescrumesoftware.com/index2.htm loads the
frames, the frame content comes from page on www.ccthecomputerguy.com
Yes.

and as
this is a different domain I cannot alter the frame contents. Am I correct
so far?
No. You can alter the *frame* contents (ie. load another document into
the frame) but you can't alter the content of a document that's already
in the frame if that document is from another domain.

Could the initial index2.htm page load a page from www.ccthecomputerguy.com
which could then load the frames and avoid this problem?


If they're both your domains why bother with all this cross-domain crap.
Structure the site properly and run it from the same domain.
--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 23 '05 #4
[snip]
Right, I know this, but the error message is pretty vague (for us javascript newbies).


Is it? It's telling you that access to the variable you're after is
denied. That's pretty much it.


Yes, it really is!! The message does not say access is denied *or why*, it
says "top.frames.xxx " is null or not an object (which is correct) -- but to
a newbie it *is* an object. Of course, once one understands the intricacies,
interactions, and security features of javascript (i.e., gets more and more
experience) this stuff becomes known and remembered.

[snip]
and as
this is a different domain I cannot alter the frame contents. Am I correct so far?


No. You can alter the *frame* contents (ie. load another document into
the frame) but you can't alter the content of a document that's already
in the frame if that document is from another domain.


Well, excuse me for being a little dense here, but while index2.htm is
loaded from a forwarded domain, the frame contents are loaded from the main
domain. I guess I'm just not understanding exactly what is transpiring
during this sequence of events :-( Hopefully the light will come -- and
soon I hope.
Could the initial index2.htm page load a page from www.ccthecomputerguy.com which could then load the frames and avoid this problem?


If they're both your domains why bother with all this cross-domain crap.
Structure the site properly and run it from the same domain.


I explained the reason why in my initial post. I have no idea what
"structure the site properly" means. Everything on my site WAD except this
frame issue.

Hopefully, I'll come up with a solution.

Thanks for your time and patience.

Charles...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.683 / Virus Database: 445 - Release Date: 5/12/04
Jul 23 '05 #5
Charles Crume wrote:
<snip>
Well, excuse me for being a little dense here, but while index2.htm is
loaded from a forwarded domain, the frame contents are loaded from
the main domain. I guess I'm just not understanding exactly what is
transpiring during this sequence of events :-( Hopefully the light
will come -- and soon I hope.

<snip>

What you re not taking into account is how the "stealth" forwarding is
done. What happens is that when a request for -
www.charlescrumesoftware.com/ ... - is made www.mydomain.com returns a
(probably dynamically generated) frameset page that only has one frame,
and that frame loads the corresponding URL from -
www.ccthecomputerguy.com -.

The effect is that when your index2.htm frameset arrives in the browser
it is itself within a frame, and that frame is the - top - frame and is
from another domain and so subject to security restrictions. However,
index2.htm and the contents of its frames are all from the same domain
so they can interact.

Your solution probably goes back to what I said earlier in the week, -
top - refers to the topmost frameset page (the one from
mydomain.com/www.charlescrum esoftware.com), but - from -
www.ccthecomputerguy.com/navigate2.htm - the - parent - reference will
refer to the immediately containing frameset page -
www.ccthecomputerguy.com/index2.htm - which is the frameset page you are
actually interested in interacting with, and is not subject to security
restrictions when accessed from navigate2.htm.

Richard.
Jul 23 '05 #6
Hello Richard;

I have a "light" -- still dim, but at least it's working <g>

"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:c8******** ***********@new s.demon.co.uk.. .

[snip]
What you re not taking into account is how the "stealth" forwarding is
done. What happens is that when a request for -
www.charlescrumesoftware.com/ ... - is made www.mydomain.com returns a
(probably dynamically generated) frameset page that only has one frame,
and that frame loads the corresponding URL from -
www.ccthecomputerguy.com -.
Ah-hah! This is the piece of information that has allowed me to understand
what is happening.

[snip]
Your solution probably goes back to what I said earlier in the week, -
top - refers to the topmost frameset page (the one from
mydomain.com/www.charlescrum esoftware.com), but - from -
www.ccthecomputerguy.com/navigate2.htm - the - parent - reference will
refer to the immediately containing frameset page -


Yes, yes -- I understand now what you have been telling me!!! Like I
mentioned earlier all the things you, and others, have been telling me make
sense, but keeping them in my head and making use of them has been somewhat
elusive -- I read right over what you had told me and *missed* your point.

I am making headway and want to thank you for your time, courteous
explanations, and patience.

Thanks again.

Charles...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.686 / Virus Database: 447 - Release Date: 5/14/04
Jul 23 '05 #7

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

Similar topics

25
3260
by: VA | last post by:
This has come up before but I am not sure if the latest versions of IE and FF change the answer. A script running on a webpage served up by http://foo.something.com should be able to do xmlhttp.open("GET","http://bar.something.com",true) But in Firefox 1.5, I get the Permission denied error Why is this? The domain is something.com so I am not crossing domains,
3
10199
by: Vongza | last post by:
<html> <head> <title>Cross Frame Reference</title> <script language="javascript"> function showThisTitle() { alert(document.title); } function showAnotherTitle() { try { alert(anotherWorld.document.title);
9
5443
by: permanent.tourist | last post by:
I'm having a hell of a job getting this to work in Safari: the only thing I can think of is that one can't use reload() across to another frame for security reasons. Does anyone have a concrete answer or solution for this? I'm trying to do this: top.frames.location.reload(); Thanks Mark Howells www.permanenttourist.ch
11
4286
by: taoberly | last post by:
A few months ago I posted a question about using a file on my hard drive to perform cross-frame scripting and pull data from a server on my company's intranet. I eventually got this working using an HTA file and Internet Explorer. Now I'm tackling a similar issue, but really need to keep the IE menus, navigation buttons, etc. this time around. Assuming a solution exists, I'm guessing it involves using the IE6 SP2 "Mark of the Web"...
3
2528
by: aspmonger | last post by:
Hello, I really believe that IE 6 has a new (intentional?) bug that severely limits the capability of dhtml and cross domain scripting. Yesterday, I read an interesting article about the subject and it only supported my claim. The article explained why Microsoft will not be letting the IE DHTML Implementation get any more powerful than it already is. Microsoft has realized that an experienced DHTML developer can create a web application that...
1
1790
by: torsten.reiners | last post by:
Hi, We try to implement a "web-application" where we have to access a general web-site -- loaded into a frame -- from another frame using JavaScript. We know that there are security issues concerning cross- domain-scripting. Our first soultion (which is working) uses the setting of the required privilege to have "Universal BrowserReas" netscape.security.PrivilegeManager.enablePrivilege ("UniversalBrowserRead");
1
1233
dmjpro
by: dmjpro | last post by:
Basically we know that JavaScript does not support cross domain scripting. But today i heard that Google does support cross domain scripting. Is that true ..if true then please explain.
16
2979
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
3987
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
8851
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8736
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
9227
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
9143
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,...
1
6676
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
4497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3202
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
2
2588
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2137
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.