PDA

View Full Version : Pop Up Window


samraza
11-23-2002, 03:30 AM
Hello! Everyone
I am kind a new to this whole JAVA thing. Please be Gentle on me

Here is my Problem.

I have an index page that pops up a full screen window with a certain URL, the page in that window has A refferal checking code as follows.

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var requiredfrom = "index.html"; // required prev. page
if (document.referrer.indexOf(requiredfrom) == -1) {
alert("You must come to this page from " + requiredfrom);
window.location=requiredfrom;
}
// End -->
</script>

If that page is accessed from some other site, instead of index page, the alert pops up redirecting visitor to the index page automatically.

Now to the problem. Even if it is opened through index page, it shows the same alert and redirects back to index, so on and so forth. And visitor never gets to see the intended page in pop up window.

Where did I go wrong?

Can someone please help?

Sincerely
A student.

beetle
11-23-2002, 08:04 AM
What if they come from

http://www.site.com/

instead of

http://ww.site.com/index.html

They are both the same page, but the top on will not proceed according to your script...