JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
FontsMadeEasy.com
 
The Business Internet
Find it on This page:
 
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

     
Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > target links within frames  
 
Display using:  
Previous Thread :: Next Thread 
 Author Thread: target links within frames
jaremyp is not online. Last active: 7/28/2004 3:52:08 PM jaremyp
www.tonawandaffl.com
Joined: 28 Jul 2004
Total Posts: 1
 
target links within frames
Posted: 25 May 2002 09:43 PM
I implemented a password function in my page. In the function depending on the password they enter, it will take them to a different page. However, I'm also using this on a Frames page and don't want the page to open in the same frame the link is on. I tried targetting the URL to the other frame (name=body), but this isn't working; I am just getting script errors. Any help with how to target the URL's would be appreciated. The function is below.

function whereTo()
{
var password = prompt("What is your password","");
magic_word=password.toLowerCase();
if(magic_word == "jaremy")
{window.location = "http://www.tonawandaffl.com/jperry.html";}
else if (magic_word == "mikeo")
{window.location = "http://www.tonawandaffl.com/mopoka.html";}
else if (magic_word == "rob")
{window.location = "http://www.tonawandaffl.com/rball.html";}
else if (magic_word == "deek")
{window.location = "http://www.tonawandaffl.com/dpizur.html";}
else if (magic_word == "randy")
{window.location = "http://www.tonawandaffl.com/rtamburlin.html";}
else if (magic_word == "chris")
{window.location = "http://www.tonawandaffl.com/cluangpakdy.html";}
else if (magic_word == "brian")
{window.location = "http://www.tonawandaffl.com/bpimm.html";}
else if (magic_word == "mikeb")
{window.location = "http://www.tonawandaffl.com/mball.html";}
else
{alert("Invalid password. Try again.");}
}


qsaaiman is not online. Last active: 5/30/2006 4:23:08 AM qsaaiman
Top 25 Poster
Joined: 28 Jul 2004
Total Posts: 21
 
Re:
Posted: 27 May 2002 01:43 AM
Hey.

You ALMOST have it all you need to do is add the frame name.

{window.framename.location = "http://www.tonawandaffl.com/jperry.html";}

HTH

Quintin Saaiman
Department of Labour
IT Systems

Quintin Saaiman
Previous Thread :: Next Thread 
Page 1 of 1
 
Jsmadeeasy.com  > JS Made Easy  > JavaScript programming  > target links within frames