Forum Moderators: open

Message Too Old, No Replies

Frame && Operator Conditionals - I'm doing something wrong here.

Probally something really minor...

         

JAB Creations

2:12 am on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This script on an anchor is supposed to go to a link in a frame called "bob" if the current location is inside a frame (not the top) else the script should send an alert saying locked and then just stop.

Here is what I have...

onmousedown="
if
(location!= top.location);
{parent.bob.location.href='http://exaple.com';}
elseif
(location == top.location)
{alert ('Locked'); return false;}
"

What am I doing wrong?

John

Dijkgraaf

2:23 am on Jan 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) Try gettin rid of the ; in
if
(location!= top.location);
2) It is "else if" not "elseif"
and you don't really need it anyway
you could have

onmousedown="
if (location!= top.location)
{parent.bob.location.href='http://exaple.com';}
else
{alert ('Locked'); return false;}
"