Can Javascript do this?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob Gordon

    #1

    Can Javascript do this?

    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


  • kaeli

    #2
    Re: Can Javascript do this?

    In article <am9trvc39i2448 u799l5ditvdq5rl i0f7l@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.lo cation = top.frames
    ['mainFrameName'].document.locat ion;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.frame s
    ['mainFrameName'].document.locat ion,'','');retu rn false;">click here to
    open the document in a new window</a>


    --
    ~kaeli~
    Every calendar's days are numbered.



    Comment

    • Rob Gordon

      #3
      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@NOSPA M.comcast.net> wrote:
      [color=blue]
      >In article <am9trvc39i2448 u799l5ditvdq5rl i0f7l@4ax.com>,
      >robert@caltrad e.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.lo cation = top.frames
      >['mainFrameName'].document.locat ion;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.frame s
      >['mainFrameName'].document.locat ion,'','');retu rn false;">click here to
      >open the document in a new window</a>[/color]

      Comment

      Working...