473,385 Members | 1,267 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,385 software developers and data experts.

Frame buster question

Hello. I was looking at various javascript suggestions for frame
busting. Typically what I have used in the past is this:

<script language="JavaScript">
<!--//
if (window != top) {
top.location.href=location.href
}
//-->
</script>

But I was visiting a site and noticed their source. I asked them
about it but it's a hosted site and the original developer has long
since moved on so no explanation. Perhaps someone here would care to
comment. It seems to me the most elaborate such routine I've come
across and frankly I don't understand much of it :) so perhaps I could
solicit your opinion. Here is the code:

<script language="JavaScript">
<!--//
if (window != top) {
top.location.href=location.href
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for
(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById)
x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new
Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
window.name = 'melody_tunes_main';

if (window != top) {
top.location.href=location.href;
}

//-->
</script>

Sep 18 '05 #1
1 1430
"Sandy Bremmer" <no_email@no_email_thanx.com> skrev i meddelandet
news:ct********************************@4ax.com...
Hello. I was looking at various javascript suggestions for frame
busting. Typically what I have used in the past is this:

<script language="JavaScript">
<!--//
if (window != top) {
top.location.href=location.href
}
//-->
</script>

But I was visiting a site and noticed their source. I asked them
about it but it's a hosted site and the original developer has long
since moved on so no explanation. Perhaps someone here would care to
comment. It seems to me the most elaborate such routine I've come
across and frankly I don't understand much of it :) so perhaps I could
solicit your opinion. Here is the code:

<script language="JavaScript">
<!--//
if (window != top) {
top.location.href=location.href
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for
(i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById)
x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new
Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
window.name = 'melody_tunes_main';

if (window != top) {
top.location.href=location.href;
}

//-->
</script>


Except that it's duplicated (at the beginning and end), this code is
identical to your own. The stuff inbetween is just crappy Dreamweaver
standard stuff that hasn't got anything to do with frame-busting.
--
Joakim Braun
Sep 18 '05 #2

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

Similar topics

1
by: Boniface Frederic | last post by:
Hello, I have frame displaying the last posted messages. I set <meta http-equiv="refresh" content="5"/> to automatically refresh the frame every 5s My problem is; if I scroll the frame to see...
7
by: David Hayes | last post by:
I tried finding an answer on http://www.quirksmode.org/ without success. I am attempting a complicated Frames structure. I have made it work in IE, but not Netscape. I begin with three...
4
by: anonymous | last post by:
Thanks your reply. The article I read is from www.hakin9.org/en/attachments/stackoverflow_en.pdf. And you're right. I don't know it very clearly. And that's why I want to understand it; for it's...
2
by: Sheryl Landon | last post by:
Hi, I'm having a similar issue as the poster Mike whose message I copied below... I have a page with an iframe... when I discover that the session state is no longer valid in the page inside 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.
2
by: wardemon | last post by:
Hi, I was wondering how can one the following in ASP.net a. Resize (Collapse/Expand) Frame A from Frame B b. Resize (Collapse/Expand) Frame A from Frame A example A I believe is found at MSDN...
6
by: Richard Maher | last post by:
Hi, Now that I am aware that JS on a page in Frame A can directly call a function on a page in Frame B, I no longer have to continue with my frameB.location.reload() fudge in order to get some...
4
by: sumitha | last post by:
Hi I am using wxpython to develop my GUI. I have 3 frame. On the first frame I have ok button and when I click that it will open 2nd frame. And when I click ok button on 2nd frame, it will open 3rd...
1
by: alpim | last post by:
Hi everbody, I am seaching a code for that problem? htdocs\iframe.html <--- This file is include with <iframe src='iframe.html'in index.html 'iframe.html' tiny source code is: <html>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.