Connecting Tech Pros Worldwide Forums | Help | Site Map

Can Javascript do this?

Rob Gordon
Guest
 
Posts: n/a
#1: Jul 20 '05
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

kaeli
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Can Javascript do this?


In article <am9trvc39i2448u799l5ditvdq5rli0f7l@4ax.com>,
robert@caltrade.com enlightened us with...

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>


--
~kaeli~
Every calendar's days are numbered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Rob Gordon
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Can Javascript do this?


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


On Fri, 21 Nov 2003 19:33:49 -0600, kaeli
<tiny_one@NOSPAM.comcast.net> wrote:
[color=blue]
>In article <am9trvc39i2448u799l5ditvdq5rli0f7l@4ax.com>,
>robert@caltrade.com enlightened us with...
>
>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>[/color]

Closed Thread


Similar JavaScript / Ajax / DHTML bytes