Nextpage script is not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MIkersson
    New Member
    • Mar 2010
    • 11

    Nextpage script is not working

    Hello, I have a framset with 3 frames:
    HEADER, CONTENT and FOOTER

    how can I get a "nextpage script" for use in the "header" and open links in "content" frame?.

    first page | Next page | Next Page | Last page

    The JavaScript Im using is:
    Code:
    <script language="javascript">
    function gonext(){
    history.forward();
    parent[whichFrame].focus();
    }
    </script>
    And the html code is:
    Code:
    <div class="navBar"><a href="arm001.html" target="content"> First Page</a> | <a href="javascript:nextPg()"> Next page</a> | <a href="javascript:history.back()" >Back page</a> | <a href="arm009.html" target="content">Last page</a> | <a href="javascript:framePrint('content');">
    Print Page
    </a></div>
    Last edited by gits; Mar 25 '10, 08:43 AM. Reason: fix quote -> to code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Try to avoid frames if at all possible.

    If you must use frames, your code uses the history to move back and forth. This could mean that you're not going to go to the correct page. If you already know the correct pages, why not have links to them 1-9 for arm001 to arm009?

    Comment

    • MIkersson
      New Member
      • Mar 2010
      • 11

      #3
      I have done that and it works FINE when I want to go to the FIRST and LAST PAGE because that links will never change, BUT when I wanna go to the NEXT PAGE the NAVIGATION keep the link pointing to the same file and is not what I need. I need to point ALWAYS to a NEXT file it doesn't matter where I am... The thing is almost like this menu:


      .
      but not as complex.
      I thank you for take your time and check my isue.

      Thanks in advance

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        What you can do is check the current page in the frame using location.href. If it's say arm005.html, use a string function, e.g. slice, substr, substring, to take the number portion and work out which should be next and previous. See String functions.

        Comment

        • MIkersson
          New Member
          • Mar 2010
          • 11

          #5
          I fixed the problem I had with another option, now It's done. But I just need to print a PDFversion from the jpg version showed in the actual page. HOw could I do that?
          When the actual page shows a "001.jpg" file in the iframe; I want to print the "001,pdf" stored in pdf/ folder

          Thank you

          Comment

          Working...