472,780 Members | 1,185 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 software developers and data experts.

Problems referencing frame containing external page


Hi frame experts c",) Hope you can help me out on this one

I've got a frameset (index.html) on my server (server A) defining two
frames. Left frame is named "menu" and contains a page (menu.html) which is
located on the same server while right frame is named "main" and contains a
page (main.html) which is located on another server (server B). This page
has a form named "f" with an element named "id". I want to access/read the
value of this element from the left frame, but I get an access denied error.
Can anybody please help me!

Just to test, I've put an exact copy of the page on server B, onto server A,
and then I have no problems accessing the value. I use the following code:

window.parent.main.f.id.value

I've also tested the frame structure (see the code below the line). When the
page in the right frame is located on server B, it seems like the whole
reference to the right frame is lost.

I also get the same results if I put all three documents on my computer and
fire up the site with http://localhost/index.html and set the right frame
source to http://127.0.0.1/main.html

I use IE

Any help is appreciated c",) Thanks!

Best regards Morten.

----------------------------------------------------------------------------
--------------

Show Frame Structure

1. Visit any web site with frames
2. Paste the following into the browser addressbar (remove any line breaks)
3. Watch a window popup which shows the frame heirarchy of the page being
visited

javascript:function
dt0(W,N,fo,i){fo=eval(N);W.document.write('<li>'+f o.name+'['+fo.document.tit
le+'-'+fo.document.location.pathname+']');if(fo.length>0){W.document.write('
<ul>');for(i=0;i<fo.length;i++){dt0(W,N+'.frames['+i+']',undefined,0);}W.doc
ument.write('</ul>');}};function
dt(W,N){W.document.clear();W.document.write('<ul>' );dt0(W,N,undefined,0);W.d
ocument.write('</ul>');W.focus();};function
s(){window.open('','W').close();W=window.open('',' W','height=500,width=500,r
esizable');dt(W,'top');};s()

----------------------------------------------------------------------------
--------------
Jul 23 '05 #1
3 1904


Morten Thorsen wrote:

I've got a frameset (index.html) on my server (server A) defining two
frames. Left frame is named "menu" and contains a page (menu.html) which is
located on the same server while right frame is named "main" and contains a
page (main.html) which is located on another server (server B). This page
has a form named "f" with an element named "id". I want to access/read the
value of this element from the left frame, but I get an access denied error.


Yes, browsers implement the same origin policy for scripts to prevent
you from loading a bank login site for instance and then sniff login
data. Unless you have host1.domain.tld and host2.domain.tld where you
can then set
document.domain = 'domain.tld'
in script to allow the access there is nothing you can do besides using
a HTML application (.hta file) for instance on Windows

http://msdn.microsoft.com/library/de...node_entry.asp
or using local pages with Mozilla and then let your script request the
privilege to access the other page.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2
Ok. Thanks for your quick and educational answer. I now understand that it's
probably for the best that we're unable to do such references. In this
particular case, I'd sure liked to be able to do it though c",) I don't know
much about the other two solutions of yours, but I guess the result would be
a private, local service and not a public web service. Right?

Morten.

"Martin Honnen" <ma*******@yahoo.de> skrev i melding
news:40******@olaf.komtel.net...


Morten Thorsen wrote:

I've got a frameset (index.html) on my server (server A) defining two
frames. Left frame is named "menu" and contains a page (menu.html) which is located on the same server while right frame is named "main" and contains a page (main.html) which is located on another server (server B). This page has a form named "f" with an element named "id". I want to access/read the value of this element from the left frame, but I get an access denied
error.
Yes, browsers implement the same origin policy for scripts to prevent
you from loading a bank login site for instance and then sniff login
data. Unless you have host1.domain.tld and host2.domain.tld where you
can then set
document.domain = 'domain.tld'
in script to allow the access there is nothing you can do besides using
a HTML application (.hta file) for instance on Windows

http://msdn.microsoft.com/library/de...node_entry.asp or using local pages with Mozilla and then let your script request the
privilege to access the other page.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3


Morten Thorsen wrote:

I don't know
much about the other two solutions of yours, but I guess the result would be
a private, local service and not a public web service.


You can offer an HTA (HTML application) on a public web server but the
user then has to download it like a normal application to run it.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #4

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

Similar topics

0
by: Michael Fork | last post by:
Note: I pasted the code the attachments as plain text after the message (I wasn't able to post it with an attachment...) Attached are the XSL and XML files that I am having problems with. I am...
12
by: Javier | last post by:
Hello, I'm very new in this forum and as I have the following problem, the website is in http://new.vanara.com ----------------------------------------------------------------------------...
24
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two...
1
by: ROBT NISHIDA | last post by:
Hello, I have a frameset page with 4 frames. There is a form in frame that contains text input boxes. I have image buttons in some of the other frames that invoke javascript functions within...
11
by: opt_inf_env | last post by:
Hello everybody, I have created a page consisting of two frames. The second frame is made to display "external" sites (i.e. written not by me, for example www.google.com). But I found that some...
11
by: Marilyn | last post by:
Hi everyone, I'm wondering if someone can help me... <sigh> I feel like I'm in a loop and can't seem to figure out how to get out of it. Here's the chronology and the problem: My site is...
6
by: Yves-Alain.Nicollet | last post by:
Hi. I have a frameset with 3 frames that look like a T, with the top frame containing buttons like a toolbar, the left frame usually containing a dynamic TOC and the right frame containing the...
42
by: smerf | last post by:
Using javascript, is there a way to trap an external page inside a frame? I've seen scripts to break out of frames, but nothing to keep a page trapped in a frame.
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.