Solved

Easy Question

Posted on 2002-04-03
10
199 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
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 …

822 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