JS doesn't work if framed by another site

by karloff <det1289(at)iperbole.bologna.it>

 Date:  Mon, 24 Jan 2000 17:41:58 -0500
 To:  hwg-languages(at)mail.hwg.org
 In-Reply-To: 
  todo: View Thread, Original
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