473,394 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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.images) {
top.location.replace(window.location.href);
} else {
top.location.href = window.location.href;
}
}

BTW: This is not with malicious intent...

- JS

Apr 27 '06 #1
3 3659
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.javascript 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.javascript 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
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
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...
1
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...
24
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#...
5
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...
1
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...
5
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...
14
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.