Solved

Open New Browser From Frame ?

Posted on 1997-12-22
10
255 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
 

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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now