netviper2008
asked on
stop redirect in Iframe
Hi all,
I am working on something for a client, but I cannot figure it out and I need help.
I am trying to use an iframe to place this page http://brunswick.1st-place.com/res/ils_frames.cfm into another page and then put ads etc around it. As soon as I try, it automatically forwards the site to that page. My understanding it happens because it has a js on it.
<script language="javascript">
<!--Hide from older browsers
if (top.location != location) top.location.href = location.href;
// -->
</script>
I asked them if they could remove it, but they said they couldn't -- however, they gave us permission to frame the site. I am not sure how to do it and I need help. I read some things on this site, but couldn't get any of them to work.
Thanks for your help.
I am working on something for a client, but I cannot figure it out and I need help.
I am trying to use an iframe to place this page http://brunswick.1st-place.com/res/ils_frames.cfm into another page and then put ads etc around it. As soon as I try, it automatically forwards the site to that page. My understanding it happens because it has a js on it.
<script language="javascript">
<!--Hide from older browsers
if (top.location != location) top.location.href = location.href;
// -->
</script>
I asked them if they could remove it, but they said they couldn't -- however, they gave us permission to frame the site. I am not sure how to do it and I need help. I read some things on this site, but couldn't get any of them to work.
Thanks for your help.
Oh man, this is a script for preventing anyone to put site into iframe, and from what I know there is no know solution to bypass this. This is needed by lot of sites because of security polices. Imagine that you have login page, and someone make a page that iframes your page, and in place that you have login box they put they own logging box (outside of iframe). So instead of typing data in your page they can steal this informaction! Thats serious problem so on web there are script like this to prevent this happens.
https://www.experts-exchange.com/questions/23454587/Prevent-Iframe-Redirect-of-Parent.html?sfQueryTermInfo=1+ifram+prevent
https://www.experts-exchange.com/questions/21926190/stop-Iframe-Redirect.html?sfQueryTermInfo=1+ifram+prevent
This one is interesting concept to use AJAX to get everything, and to cut off javascript that breaks frame - this should work:
https://www.experts-exchange.com/questions/21707999/Disabling-frame-busting-script.html
Here is something for IE:
https://www.experts-exchange.com/questions/23454587/Prevent-Iframe-Redirect-of-Parent.html?sfQueryTermInfo=1+ifram+prevent
https://www.experts-exchange.com/questions/21926190/stop-Iframe-Redirect.html?sfQueryTermInfo=1+ifram+prevent
This one is interesting concept to use AJAX to get everything, and to cut off javascript that breaks frame - this should work:
https://www.experts-exchange.com/questions/21707999/Disabling-frame-busting-script.html
Here is something for IE:
https://www.experts-exchange.com/questions/23454587/Prevent-Iframe-Redirect-of-Parent.html?sfQueryTermInfo=1+ifram+prevent
I have a solution for you netviper2008:
<HEAD>
<TITLE>Zvonko *</TITLE>
</HEAD>
<FRAMESET ROWS="70,*" FRAMEBORDER="0" FRAMESPACING="0" BORDER="0">
<FRAME SRC="http://brunswick.2nd-place.com/res/ils_top.cfm" NAME="1stPlaceILSframeset" SCROLLING="NO" NORESIZE>
<FRAME SRC="http://brunswick.2nd-place.com/res/ils_map.cfm" NAME="botframe">
</FRAMESET>
</HTML>
Hmm Zvonko I have completly no idea how this could help netviper :))
ASKER
Is there a JS solution vs using ASP?
You need no JS and no ASP to add the frames to your page. Simply make YOUR frameset like I did.
If you still have no idea then ask. But I am assuming that my example is selfexplaining...
If you still have no idea then ask. But I am assuming that my example is selfexplaining...
ASKER
Zvonko,
What you did doesn't work. Try it yourself.
What you did doesn't work. Try it yourself.
Zvonko are you sure that you read this question precisely ?:)
netviper.. Only one sollution I think about now is to use server side script that will download page and cut off javascript that breaks iframe. (something like written in ASP).
netviper.. Only one sollution I think about now is to use server side script that will download page and cut off javascript that breaks iframe. (something like written in ASP).
Of course it did not work because I change the URL from 1st to 2nd!
Sorry, I did not test it. I have removed the script from frameset.
But the frame named botframe is doing frame chaking and set the cookie VALIDFRAMESET on ColdFusion server side.
If it does not get that cooki then it responds with only this page content:
<SCRIPT LANGUAGE="JavaScript">
top.location.href='http://Brunswick.1st-place.com/misc/breakframes.cfm';
</SCRIPT>
But the frame named botframe is doing frame chaking and set the cookie VALIDFRAMESET on ColdFusion server side.
If it does not get that cooki then it responds with only this page content:
<SCRIPT LANGUAGE="JavaScript">
top.location.href='http://Brunswick.1st-place.com/misc/breakframes.cfm';
</SCRIPT>
" however, they gave us permission to frame the site."
If they gave you specific permission to "frame the site" then simply clone that site setup to your own site, remove the code you listed that breaks out of any frame or iframe, and put YOUR redone code into your site in the iframe -- this assumes you have their permission to do it. If you can't do that, you will NEVER defeat the code specifically designed to break the site out of any iframe or frame -- you must remove that code.
If they gave you specific permission to "frame the site" then simply clone that site setup to your own site, remove the code you listed that breaks out of any frame or iframe, and put YOUR redone code into your site in the iframe -- this assumes you have their permission to do it. If you can't do that, you will NEVER defeat the code specifically designed to break the site out of any iframe or frame -- you must remove that code.
netviper as I told you before, there is no known pure javascript solution for that. You need some server side scripting to achieve that. Check link that I gave you...
ASKER
wilq32,
I don't have an ASP server to try it on, only PHP. :(
I don't have an ASP server to try it on, only PHP. :(
For PHP check CURL function, it is very simple to use and you will achieve what you want (i think :>)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It looks like the solution is there is no solution. Thanks for everyones help.
how this answer is better than other answers ?
On your page write:
Open in new window