住宅ワークなら内職.jp - Property in Qatar - Payday Loans - Lockers - Deaf Topics

PDA

View Full Version : Javascript redirect w/o a pop-up.


jiggawattjoseph
Sep 8th 2006, 4:49 pm
I am trying to integrate a promo section into my website. Basically, I want people to be able to enter a promo code into a form, and if the promo code is valid, be redirected to a different section of the site. It doesn't need to be particularly secure, and all the promo codes are the same. Here is the code I am using:

if ( document.form1.password.value == "xxxxx" )
{
open('localpage','_self');

} else {
alert("Your promo code is incorrect. Please register.");
}

This works, but only if you substitute _blank for _self, which spawns a new browser. I want to keep the same browser window. Any ideas on how to keep this in the same window?

noppid
Sep 8th 2006, 4:55 pm
Um, er, can't that password be cracked in one pageview?

wmburg
Sep 9th 2006, 12:24 am
window.location="promo.html";