473,656 Members | 2,762 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

force external page into iframe?

If I try to put a site into an iframe that has "escape frame" code in
its source (posted below), it will reload the requested page into the
parent instead of the iframe. Is there a way to prevent this from
happening?

One could use onunload to stop the redirection, but I would like to
find a way to load a page into an iframe, even if it has this type of
code.

I have considered server code loading the content and re-displaying it
but I would like to find a pre javascript solution.

//this is not my code
if (self != top) {
if (document.image s) {
top.location.re place(window.lo cation.href);
} else {
top.location.hr ef = window.location .href;
}
}

BTW: This is not with malicious intent...

- JS

Apr 27 '06 #1
3 3670
jshanman wrote:
If I try to put a site into an iframe that has "escape frame" code in
its source (posted below), it will reload the requested page into the
parent instead of the iframe. Is there a way to prevent this from
happening?


No. Otherwise there wouldn't be a lot of point in the author having the
frame escape code.

--
David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Apr 27 '06 #2
jshanman said the following on 4/27/2006 11:42 AM:
If I try to put a site into an iframe that has "escape frame" code in
its source (posted below), it will reload the requested page into the
parent instead of the iframe. Is there a way to prevent this from
happening?
Yes, you stop trying to Frame other peoples pages in your own page and
you don't have a problem anymore.
One could use onunload to stop the redirection, but I would like to
find a way to load a page into an iframe, even if it has this type of
code.
You think you can use onunload? Try again.
I have considered server code loading the content and re-displaying it
but I would like to find a pre javascript solution.


Go server code. Client side isn't going to happen.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 27 '06 #3
Randy Webb wrote:
jshanman said the following on 4/27/2006 11:42 AM:
If I try to put a site into an iframe that has "escape frame" code in
its source (posted below), it will reload the requested page into the
parent instead of the iframe. Is there a way to prevent this from
happening?


Yes, you stop trying to Frame other peoples pages in your own page and
you don't have a problem anymore.
One could use onunload to stop the redirection, but I would like to
find a way to load a page into an iframe, even if it has this type of
code.


You think you can use onunload? Try again.
I have considered server code loading the content and re-displaying it
but I would like to find a pre javascript solution.


Go server code. Client side isn't going to happen.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Thats what I thought.

FYI: This actually isn't something that I would ever do for myself, a
freelance project was posted with this as one of the requirements. I
was fairly sure it was impossible (using only javascript/iFrames), but
now I'm 100% sure! Thanks!

- JS
http://www.endeavorpub.com

Apr 28 '06 #4

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

Similar topics

19
36535
by: Jay | last post by:
I'm trying to refresh browser when some new information is available in DB. is there any way to force to refresh browser? Thanks. -Kev
5
5196
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have to wait for the external resource to load to show up the page, thus giving a perceiving faster load time for the user.
1
2687
by: Robert de Ridder | last post by:
I use an asp page to display pages, where the dynamic content is in an iframe. To calculate the height of the iframe I use the calcheight function. However when trying to do this with external pages, I get an access denied error, and the iframe won't display correctly. Is there a way to solve this or another way to calculate the height for the iframe. The relevant code displayed below. Thanks in advance for any help,
24
5231
by: ej1002 | last post by:
Hi I have developed a Windows Application(C# Windows Form) which will get the IFrame Source of the page it is navigating using Webbrowser Control. Now I want do this in ASP.Net web application(C# Web Form). Is there any other method through which I will be able to access the IFrame Source of the page I am navigating to. Also I need to click on some of the links in the page I am navigating. Requirement is to read the data the IFrame source...
5
4470
by: Jeronimo Bertran | last post by:
I have a DataGrid that gets filled based on a filter which is defined by the values that the user selects on several controls. When the page postbacks after changing the selection on the filter controls, the DataGrid refreshes itslef. Now, I also need to refresh the DataGrid if I detect that something "external" has changed (keeping the filter that the user is using). For this, I have created a page that partially refreshes itslef in...
1
6487
by: dd | last post by:
I have a situation where the browser memory goes up and up as each Ajax call causes new content to be deployed into a DIV. I'd like to know if I can force garbage collection to occur. More detail: My code is loaded in an iframe which is in a div. The parent page looks like this (my code is in firstiframe.html): <div id="main div">
5
3685
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually for repeated html im using the external js, i mean the TOP, BOTTOM they are repeated in every page, so i include them as functions in the external js and call them. Why it doesn't work?
14
3610
by: eddy.pagotto | last post by:
Hi, I'm trying to display external link into a DIV (http:// www.google.com/, for example). I don't want to use IFRAME, because I already tried it and I'm not satisfied about the results. How can I simulate IFRAME? Possibly without using Ajax. I passed all the day looking for scripts that can help me, but unsuccessfully. Thanks in advance for any suggestion,
0
8297
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
8717
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...
0
8600
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
7311
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
6162
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
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.