RE: JS doesn't work if framed by another site

by Rebecca Campbell <rcampbel(at)standard.com>

 Date:  Mon, 24 Jan 2000 11:18:29 -0800
 To:  "'karloff'" <det1289(at)iperbole.bologna.it>,
hwg-languages(at)mail.hwg.org
  todo: View Thread, Original
sounds like you just need to include the entire location of the javascript
file...

src="http://www.yourserver.com/script/layerhtm.js"

-rebecca
http://www.nerdygirl.com

-----Original Message-----
From: karloff [mailto:det1289(at)iperbole.bologna.it]
Sent: Monday, January 24, 2000 2:42 PM
To: hwg-languages(at)mail.hwg.org
Subject: JS doesn't work if framed by another site


Hi, here's my problem:

I've used a lot of Javascript in my home page
http://www.galleriaborghese.com/index.htm ,
but I've noticed a problem:
The web directory http://sfera.supereva.it/ in the directory Arte/Grandi
musei/ has made a link to my page, showing it in a frame.

In my page I've included some code to avoid to be framed in other sites

	<SCRIPT LANGUAGE="JavaScript">
	<!--
	if (parent.location.href != window.location.href)
parent.location.href =
window.location.href;
	// -->
	</SCRIPT>

but some of the code is in some external javascript files

	<SCRIPT LANGUAGE="JavaScript1.2" SRC="script/showhide.js"></SCRIPT>
	<SCRIPT LANGUAGE="JavaScript1.2" SRC="script/layerhtm.js"></SCRIPT>

Due to the use of external files, the code doesn't works at all: in fact
it's impossible to load an external js file from a server different from
mine (I guess it's a security option of my server, am I right?), and even
the "unframing" code is not executed.

Does someone knows how to load an external javascript file USING
JAVASCRIPT, to write something like

	if (parent.location.href == window.location.href)
load("script/showhide.js");

and beat the framer? Or should I copy my external code in the index.htm
file (and in every page that includes external javascript files)?

TIA
Carlo


| /\/ /      Carlo Fava (det1289(at)iperbole.bologna.it)
|/|/\/       Art & Religion, www.romagiubileo.it/assisi/
|\|\/\       Cinema, www.geocities.com/Hollywood/6841/viaggioinitalia/
| \/\ARLOFF  Art, www.galleriaborghese.it

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.