Click to See Complete Forum and Search --> : "Double" remain-in-frames script ???
bleep
07-13-2003, 10:41 AM
I have this little script in each of my html files to keep them within the frameset:
<script language="JavaScript" type="text/javascript"><!--
if (parent.location.href == self.location.href)
window.location.href = 'frameset.html';
//--></script>
Now I'm planning one more frameset with the same content. And instead of having a duplicate of each html file I'd like to extend/enhance the above script so the files will remain in both "frameset_1.html" and "frameset_2.html".
Is this possible?
bleep
07-15-2003, 08:11 PM
Just me again. I think I've found a solution. The below script can, if I'm interpreting it correctly, remain in as many framesets as the user see fit.
Can anyone please check the script out to look for errors and such in it?
<script language="JavaScript" type="text/javascript"><!--
// Enter all the possible web addresses that your site's frameset
// page can be accessed online, such as with and without the 'www'
ok_urls = new Array();
ok_urls[1] = "http://www.sitename.com/frameset.1.html";
ok_urls[2] = "http://www.sitename.com/frameset.2.html";
ok_urls[3] = "http://www.sitename.com/frameset.3.html";
ok_urls[4] = "http://www.sitename.com/frameset.4.html";
function reportError(msg, url, line) {
if (url == window.location.href) {
msg = "\nBandwidth Theft Alert!\n\n" +
"This site is illegally stealing bandwidth\n" +
"from our site, WWW.ANUNCIOSCLASIFICADOS.BIZ.\n\n" +
"We will now load the content page\n" +
"from our server so you may view it.\n\n" +
"Thanks for your patience!";
alert(msg);
top.location.href = ok_urls[1] + "?" + window.location.href;
return true;
}
}
window.onerror = reportError;
url_found = 0;
for (var i = 1; i <= ok_urls.length && !url_found; i++) {
url_found = (parent.location.href.indexOf(ok_urls[i]) == -1);
}
if (!url_found || (window == top))
top.location.href = ok_urls[1] + "?" + window.location.href;
// End --></script>
And if someone could tell me exactly what to delete in it to get rid of that ridiculus alert thing I'd be most grateful.
Thanks.
Originally posted by bleep
msg = "\nBandwidth Theft Alert!\n\n" +
"This site is illegally stealing bandwidth\n" +
"from our site, WWW.ANUNCIOSCLASIFICADOS.BIZ.\n\n" +
"We will now load the content page\n" +
"from our server so you may view it.\n\n" +
"Thanks for your patience!";
alert(msg);
Just remove the line alert(msg);
:)