Click to See Complete Forum and Search --> : URLs opening outside frame


hoganlia
08-30-2003, 05:32 PM
First of all I must state that I know NOTHING about javascript aprt from the end effects. I am desgning my first web with FrontPage 2002 and have (nearly) everything Ok. My web cinsists of a header and 6 body pages. On a few of those body pages there are lists of URLs and my problem is that with some of them, they open outside the frame. I have been given 2 javascripts to use and have tried to insert them where I thought I was being directed. The result is that the javascript turns up as a text on the wysiwyg page.

Following are the 2 scripts and my initial script. I would appreciate help as to where to place them exactly and how to activate them.
Thanks.
(starting with MY script).. ah, ignore Spanish, my FP is Spanish.

<html>

<head>
<meta http-equiv="Content-Language" content="ca">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Pagina nueva 1</title>
<base target="principal">
</head>

<body background="images/Adv%202.gif">

<p align="center"><font face="BrushScript BT" size="6">
<a name="Activities for advanced levels">Activities for advanced
levels</a></font></p>

The scripts I was given are: 1) In the "head" section, but I don't know where...

<script language="Javascript">
if (self == top){top.location.href="http://www.yoursite/yourframepage.htm"}
</script>

and 2) after "BODY" flag, and they say "before any other text."

<SCRIPT LANGUAGE="javascript">

if (self==parent)
{
document.write('<b>THIS IS A FRAME ELEMENT</B>')
document.write('You will be transported to frames in a second')
document.write('<META HTTP-EQUIV="refresh" CONTENT="1; URL=framepage.html">')
}

</SCRIPT>

Thanks

gcrowan
08-30-2003, 10:44 PM
Please include the entire code for one of the problem pages along with the main frames page. Better yet, can you give me the url to the site.

Khalid Ali
08-31-2003, 06:26 AM
Honestly I did not understand completely what you are looking for ,however, here is the response to what I did understood.

If you are worried that your links shoudl open in a subframe then use this

parent.frameName.location.href = url;

and if your concern is that you did not wnat anybody to open your pages other then in your frameset then the cods provided to you should work.

hoganlia
08-31-2003, 08:41 AM
Khalid, thanks for the script. The only thing is that as I pointed out in my query, I am a complete beginner at this. Exactly where do I put this, in header or in body, and in what position? Do I need to script <....> etc? Could you please give me a complete script + position.
Many thanks

Khalid Ali
08-31-2003, 10:33 AM
Any javascript code will always be in script tags including the code I posted above

Second,post the code in between the <head> tags