Solved

Open New Browser From Frame ?

Posted on 1997-12-22
10
260 Views
Last Modified: 2008-02-01
My page has two frames. The left one contains some links who are
               directed to the main frame.
               I need to be able get out of the frame either by destroying the frame but
               stay on the same browser
               or open a new browser.
               The last option would be ideal but I want the new browser to start where
               the old stops.
               ie if was on yahoo.com I want the new browser to start on Yahoo.com
               and not on your defaut page.
               Exactly like the "open Frame in new window" funcion on Netcape 4. But
               working on all browser.

               Is it possible ?

               I am really stuck at that point and would need some savvy advices.

I tried

<a href="#"
               onClick="javascript:window.open(parent.mainframe.location)">Click Me</a>

but i receive a :
:missing semicolon before statement"  error

               Thankfully,

              chris
0
Comment
Question by:chrispaje
10 Comments
 
LVL 1

Expert Comment

by:rets
ID: 1277120
To stay in the same browser use:

<A HREF="link.html" TARGET="_top">

_top is the special word which indicates to 'start all over from the top'

To create a completely new browser use:

<A HREF="link.html" TARGET="_new">

_new is the special word which indicates to 'start a new browser'

-K
0
 

Author Comment

by:chrispaje
ID: 1277121
I would like to have the new browser to open to the current url not a pre-defined one.

thank you
0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277122
What you need is:

<a href="#" onClick="self.location=parent.RightFrameName.location" target="_top">Click Me</a>

This will open what ever you are looking at in the right frame and load it so that it covers (sits on top) of your frames.  When you press the 'Back' button, you will go back to your frames page.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

Author Comment

by:chrispaje
ID: 1277123
<a href="#" onClick="self.location=parent.RightFrameName.location" target="_top">Click Me</a>

with RightFrameName being "main still makes the left frame appearing in the right one and not whatever url is on the right frame.

Any idea
0
 

Accepted Solution

by:
jfl earned 50 total points
ID: 1277124
This works for N4:

<a href="#" OnClick="window.open(parent.RightFrameName.location);">Click Me</a>

IE4 will do nothing about this, but try to look at MS's site for more info on window.open
See if you can find an example.


0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277125
Evidentally, the onClick method did not act like I thought it would.  The anchor below will bring whatever is in the right frame to the top in the same browser window.

<a href="javascript:top.location=parent.RightFrameName.location" target="_top">Click Me</a>

If this is what you want and works for you, please allow me the opportunity to post it as the answer.
0
 

Author Comment

by:chrispaje
ID: 1277126
Thank you

This is excactly what I need.It works great on N3 and 4.

Any idea for IE browser.


0
 

Author Comment

by:chrispaje
ID: 1277127
Bummer !!

Actually

<a href="#" OnClick="window.open(parent.RightFrameName.location);">Click Me</a>

only works for when the files are located in your hard drive.not online. As soon as you go online you get that

The requested URL /[object was not found on this server.

I am getting desperate here

JavaScript:top.location=parent.main.location

doesn't work either. It gives me the javascript line on the url location bar :

Location : JavaScript:top.location=parent.main.location

and the name of the default domain name in the body message

Anybody have an idea ??


0
 
LVL 6

Expert Comment

by:tecbuilder
ID: 1277128
Since you accepted the answer you won't get any help from anyone else since it costs us (experts) points.  If you would have reviewed my answer, you would have found that it does what you wanted and will work on MSIE and Netscape.

I would suggest not being so quick to accept an answer until your question is solved.  Once you accept an answer the answerer may or may not respond.  They are not getting any points for the additional questions.  As it stands, you gave someone points for a partial answer and the other part they tell you to go find the answer.  Isn't that what you came here for?
0
 

Author Comment

by:chrispaje
ID: 1277129
Sorry to have been so prompt to take the answer for correct.
I'll try to get the answer somewhere else since I am out of points. Thanks anyway.

but this line definitely doesn't work.

<a href="javascript:top.location=parent.RightFrameName.location" target="_top">Click Me</a>

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

821 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