Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Easy Question

Posted on 2002-04-03
10
Medium Priority
?
228 Views
Last Modified: 2010-04-09
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
Comment
Question by:mofoworking
  • 5
  • 5
10 Comments
 
LVL 30

Expert Comment

by:third
ID: 6917198

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

0
 
LVL 2

Author Comment

by:mofoworking
ID: 6917207
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
 
LVL 30

Expert Comment

by:third
ID: 6917209
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 30

Expert Comment

by:third
ID: 6917213
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
 
LVL 30

Accepted Solution

by:
third earned 400 total points
ID: 6917217
or parent.frames['main'].location.href
0
 
LVL 2

Author Comment

by:mofoworking
ID: 6917222
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
 
LVL 2

Author Comment

by:mofoworking
ID: 6917230
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
 
LVL 2

Author Comment

by:mofoworking
ID: 6917231
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
 
LVL 2

Author Comment

by:mofoworking
ID: 6917239
BINGO

thanks heaps for this

sorry about the old question

0
 
LVL 30

Expert Comment

by:third
ID: 6917243
no problem... just keep it up!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question