• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Easy Question

I have a script in my webpage that goes a little like this

<script language="JavaScript">
<!---
       function pass() {
          var password = prompt("Password required for this area:", "")
          var location = password + ".html";
          this.location.href = location;
       }
// --->
</script>

i put it on a link that i create, and it opens a location if the correct name is used

is there a way i can use this in frames

instead of calling this.location

calling the main fram as the place to open the location

thanks
0
mofoworking
Asked:
mofoworking
  • 5
  • 5
1 Solution
 
thirdCommented:

<script language="JavaScript">
<!---
      function pass() {
         var password = prompt("Password required for this area:", "")
         var loc = password + ".html";
         parent.location.href = loc;
      }
// --->
</script>

0
 
mofoworkingAuthor Commented:
Close,
i knew it was going to be easy,
but it opens it up in the entire window

i just want it in a fram called Main

thanks third

0
 
thirdCommented:
your last question seem to be aging,

11/21/00 25 Databases...i know i know UnlockedQ

is it ok if you settle this first?

for your convinience, here is the link

http://www.experts-exchange.com/jsp/qShow.jsp?ta=dbgen&qid=11929958
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
thirdCommented:
then just use

main.location.href


<script language="JavaScript">
<!---
     function pass() {
        var password = prompt("Password required for this area:", "")
        var loc = password + ".html";
        main.location.href = loc;
     }
// --->
</script>

0
 
thirdCommented:
or parent.frames['main'].location.href
0
 
mofoworkingAuthor Commented:
Close,
i knew it was going to be easy,
but it opens it up in the entire window

i just want it in a fram called Main

thanks third

0
 
mofoworkingAuthor Commented:
that does not seems to work

is says, main undefined

but i definatley call one of my frames "Main"

do i need to put the script in the fram where the link is
or the framset

0
 
mofoworkingAuthor Commented:
that does not seems to work

is says, main undefined

but i definatley call one of my frames "Main"

do i need to put the script in the fram where the link is
or the framset

0
 
mofoworkingAuthor Commented:
BINGO

thanks heaps for this

sorry about the old question

0
 
thirdCommented:
no problem... just keep it up!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now