Can Javascript do this?

R

Rob Gordon

Hi all,

I have a web portal I have been developing where I have put together a
fairly nice navigation system using frames. There is a left hand
menu, a "main" frame and a header and footer frame. Everything url
that a user clicks is displayed in the "main frame". I want to give
my users a function called "New Window" in the footer frame that will
"break" the main frame and open whatever is there in a separate
window. This will allow me to add more interesting contents since I
will no longer be "trapping" people in my frame system.

The problem is I don't know Javascript and my venture is not funded so
I can't pay anything right now but I would be very grateful is someone
knows if there is an easy way to do this. I tried to explain this to
some programmer friends of mine but I'm not sure we communicated
because they recommended what seemed like a complimented and involved
approach.

At first I was trying to find a function that would "look at" whatever
iis in the main frame and open it in a new window. I've looked at
this issue again, and I think it can be solved a different way without
referirng to "frames" at all. Would it be possible to write a
function in Javascript that would "remember" whatever the last url
clicked, and then open this in a new window? I think this would do
the exact same thing. My portal is at the link below if you want to
see why I need this.

Thank you

Rob

http://www.caltrade.com
 
K

kaeli

To open the document that is in the main frame in the same window...

In the bottom frame...

<a href="#" onClick="top.location = top.frames
['mainFrameName'].document.location;return false;">click here to open
the document in this window</a>

where mainFrameName is the name you gave the main frame in the frameset.


If you want it in a new window...
<a href="#" onClick="window.open(top.frames
['mainFrameName'].document.location,'','');return false;">click here to
open the document in a new window</a>
 
R

Rob Gordon

Very close Kaeli,

This technique worked for a linked page in the main frame that I
created and was on my server- but it doesn't work for a link to an
outside site. The main reason I want this is so I can bring up
outside sites in my frames but give the user the option of breaking
out of the frame. With this code- when you click on a link to an
outside site, a copy of the footer frame appears in the main frame
windiow. But we are close!

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,264
Latest member
FletcherDa

Latest Threads

Top