473,765 Members | 2,035 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send message from top to iframe (frame) when pages are on different servers?

Hi

The problem is:
I want to allow partially display my page in iframed version, but only
for one address.

top page (http://location1/top.html) code: <iframe name='iframed'
id='iframed' src='http://location2/iframe.html'></iframe>

I cannot call any function from top or parent in case of security
errors.

I tried to:

1. check if this.name == 'iframed'
This worked unless one click to any link in the iframed page (the
name changes)

2. check top.location value
Breaks in case of security bug

Is there any way to send any information to iframed page or receive any
information about top page?
Of course where page location servers are different ?

Piotr

Mar 21 '06 #1
2 2182
Keep in mind that it's rediculously easy to thwart this if someone is
trying to, but it will stop the automated ones:

<iframe name='iframed'
id='iframed'
src='http://location2/iframe.html?inm yframe=true'></iframe>

Then parse out the querystring and make sure it says what you want it
to say.

It's possible that you could use document.referr er instead, but I'm not
sure all the implications of that with how your iframed page moves.

Mar 21 '06 #2
zalun wrote:
I want to allow partially display my page in iframed version, but only
for one address.

top page (http://location1/top.html) code: <iframe name='iframed'
id='iframed' src='http://location2/iframe.html'></iframe>

I cannot call any function from top or parent in case of security
errors.
Exactly. Search the archives for "Same Origin Policy".
Is there any way to send any information to iframed page or receive any
information about top page?
Generally, no. Especially, the protocols, the second-level domains, and the
port addresses of the two URI references must be the same, or you will have
to use a signed script to request the required privileges (or lower the
security level of the user agent, but that is not recommended).
Of course where page location servers are different ?


The physical location does not matter, the logical one (addressing) does.
PointedEars
Mar 22 '06 #3

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

Similar topics

1
4161
by: Sean Nolan | last post by:
So it's always been easy to know if I'm running framed: if (window != top) .... Here's one I can't seem to figure out. Is there a way to determine if the frame I am in is a FRAME or an IFRAME? I'm hoping this is an easy one, but it's got me stumped, and I haven't found any good info here or on the web as of yet. Oh, it has to work cross-site, too ... so my easy solution to just
3
3217
by: Dany P. Wu | last post by:
Hi everyone, I am trying to create a site with pages containing iframes. This is the first time I've used inline frames and am still struggling with the concept. This site will have 10 pages and so far I have created 20 files, each page having to use a pair of files. One file for the actual page, and one file for the content of the inline frame. It sounds bloody silly to me but then again I am only a beginner at web
2
1860
by: google | last post by:
I have a HTML file that contains an iframe. The HTML file is served by one server. The iframe contains a link to a completely different server. My question is, can any action in the iframe (such as a form submit) cause the look and feel of the containing HTML to change, such as I want some table elements in the parent (that contains the iframe) to change or disappear. For example, a HTML file has a table with 3 rows, the first and...
3
6745
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The application is based on mysql and php on a remote server, and is accessed by the user via a web browser, primarilly IE. The image file names are built up by the server side php scripts, and so a URL for the image file is created, but the file itself is...
6
15015
by: Valued Customer | last post by:
Hello, I'm really at a loss here. I have the following index.html: <div align="center"> <iframe src="left.htm" width="15%" height="100%" frameborder="0" name="left" target="contents"> <iframe src="main.htm" width="85%" height="100%" frameborder="0" name="main" scrolling = "no"> </iframe>
26
3248
by: shlomi.schwartz | last post by:
using this example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Test Page</title> </head>
1
3576
by: bulldog8 | last post by:
I am working on a picture preview page ... some questions and suggestions have been incorporated already, but the 'user' (i.e. wife!) would like it to be more user friendly (if it isn't one thing, its another!!) The page is basic - a generic, blank page with navigation a picture presentation area, and a frame showing different thumbnails. Problem: Once the user has scrolled down the frame and selected a picture, the frame resets to...
0
1508
by: johnw182 | last post by:
Ok, I have a asp.net project. Everything works great. HOWEVER, this project was made to be called from within a frame or iframe. When being used within the iframe the user gets a blank frame when clicking certian buttons. Here is the code for the iframe. <iframe src="http://www.website.com/?cid=A195E1A9-A5D7-4046-89A4-1C00D4F81E35" id="frameName" frameborder="0" width="550" height="750"></iFrame> Here are the steps taken to reproduce.
68
4730
by: zwsdotcom | last post by:
I've been looking for references for some weeks now, but haven't found an answer to the following question. I'd love some help on this: *Without* using JavaScript or other active client-side scripting, server-side includes or frames, is there a way to include a standard header on all pages within a site? The design goal is to have the header links and title graphic on every page kept in some single place, so that a change to the header...
0
9568
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
9399
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
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
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
9835
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...
1
7379
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
6649
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
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.