Solved

Easy Question

Posted on 2002-04-03
10
204 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 100 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

828 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