Click to See Complete Forum and Search --> : Javascripting for html web page


Valareos
03-10-2003, 06:01 PM
I need help with a bit of java scripting for a web page. I have my page set to activate a cookie on their first visit, anddirect them to a small ad that helps me maintain the site. For teh rest of the day, they dont see that add again, because I only get credit for a view once a day. However, a lot of people are going around this by going directly to the main site. Is there any way to script it so that on the main page it checks for that cookie, and if it doesnt exist, redirect them to my First Page? Or to keep them from entering the page unless they came from a certain url?

pyro
03-10-2003, 06:37 PM
How about something like this:

if (document.cookie == "")
{
window.location = "firstpage.htm"
}

Valareos
03-12-2003, 10:38 AM
That was the first thing I tried, but It was giving me javascript errors. Perhaps Im doing it wrong. the page I want to keep them from getting to if they dont have a particular cookie is not the same page that loads the cookie