PDA

View Full Version : Why should scripts......


swallow
09-12-2002, 01:02 AM
.......work sometimes but on other occasions not at all? Answers on a postcard please.

I am trying to link to my "frames" website through a Newsletter that I would like to send out. I wanted the link to send the reader to teh right page in my frames set up so I used a script that I got from this forum.

I put this script in the head of the target page, which I wanted to remain in frames:

<SCRIPT LANGUAGE="JavaScript">
if (self == top)
{
var url = self.location;
self.location = "index.html?" + url;
}
</SCRIPT>

Then I put this script in the head of my frameset page:

<SCRIPT LANGUAGE="JavaScript">
function frame_saver()
{
if (self.location.search)
{
parent.main.location = location.search.substring(1,location.search.length);
}
}
window.onload = frame_saver;
</SCRIPT>

My frameset is saved but it is the initial page that is loading. I actually saw this work whether through a link or even if I typed in the url. Suddenly it does not work anymore.

Help........Going Crazy.