Opening URL in frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Delaney

    #1

    Opening URL in frame

    Hi there

    Could someone please help, I have very little grasp of javascript, I have
    tried but cannot get either of the two things I want to do together to
    work.

    I have a webpage with frame with nav buttons - Next and Prev - at the
    bottom whilst the top frame hs a URL from a search engine along the lines
    of page1search.htm . What I want to do is to press Next and it call a
    function to change the top frame to page2search.htm but despite trying for
    some time I can't get my head round how to do it!

    My variables don't seem to add the pages on - var num=0 outside the
    function and then num=num+1 each time its called added into the string as
    "page"+num+"sea rch.htm", that is correct?

    And I also am having problems trying to open the page in the top frame, it
    doesn't seem to no mater what method I use!

    Could someone please point me in right direction??

    Many thanks

    Paul
  • @SM

    #2
    Re: Opening URL in frame

    Paul Delaney a ecrit :
    [color=blue]
    > Hi there
    >
    > Could someone please help, I have very little grasp of javascript, I have
    > tried but cannot get either of the two things I want to do together to
    > work.
    >
    > I have a webpage with frame with nav buttons - Next and Prev - at the
    > bottom whilst the top frame hs a URL from a search engine along the lines
    > of page1search.htm . What I want to do is to press Next and it call a
    > function to change the top frame to page2search.htm but despite trying for
    > some time I can't get my head round how to do it![/color]

    so you have a page with at least 2 frames
    in the html code you can name this frames
    <frame blabla name="search" >
    <frame blabla name="menu" >
    <frame blabla name="main" >

    any need of JavaScript !

    in the page "menu.htm" loaded in frame "menu"

    <a href="page2sear ch.htm" target="search" ><img
    src="button_nex t.jpg" border=0></a>


    in JS
    <a href="javascrip t:parent.search .location='page 2search.htm';"
    [color=blue]
    > My variables don't seem to add the pages on - var num=0 outside the
    > function and then num=num+1 each time its called added into the string as
    > "page"+num+"sea rch.htm", that is correct?[/color]

    var num=0;
    function gopage(sens){
    num=num+sens*1;
    if(num>0)
    parent.search.l ocation='page'+ num+'search.htm ';
    else
    parent.search.l ocation='page0s earch.htm';
    }

    <a href="javascrip t:gopage(1);">N ext</a>
    <a href="javascrip t:gopage(-1);">Previous</a>


    --
    *************** *************** *************** *************** **
    Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
    Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

    *************** *************** *************** *************** **


    Comment

    • Paul Delaney

      #3
      Re: Opening URL in frame

      "@SM" <stephane_moria ux@wanadoo.fr> wrote in
      news:3FDA7151.D 19DD26C@wanadoo .fr:

      [SNIP]
      [color=blue]
      > var num=0;
      > function gopage(sens){
      > num=num+sens*1;
      > if(num>0)
      > parent.search.l ocation='page'+ num+'search.htm ';
      > else
      > parent.search.l ocation='page0s earch.htm';
      > }
      >
      > <a href="javascrip t:gopage(1);">N ext</a>
      > <a href="javascrip t:gopage(-1);">Previous</a>[/color]

      Thanks, that works perfectly, much appreciated and Merry Christmas!

      Paul

      Comment

      Working...