Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Thanked 0 Times in 0 Posts

    Browser Navigation Demonstrator

    I have been given a scenario to do as a bit of work for my course the scenario is below:

    The communication protocols on the Internet such as HTTP are stateless. State can be maintained in a number of ways within the client server architecture. One weak technique used by the HTTP client to maintain state is to keep a record of previously visited Uniform Resource Locators. These locations are stored by the client and accessed via the backward and forward button of the web browser.

    Design Brief
    Design a system that models the way the client browser maintains the aforementioned state. The system must allow the user to enter a new URL into the system and either go back to a URL loaded previous to the current URL or go forward to a URL loaded after the current URL. The storage mechanism used by the browser must include two stacks (one backward and one forward) both of which support the following behaviour:

    Pop item from stack
    Push item onto stack
    Empty a stack

    Generally speaking, the backward stack stores items of previously visited URLs and the forward stack stores items moved from the backward stack to the forward stack.

    The system must allow the user to interact in three ways: enter a new URL, recover URLs from the backward stack; and recover URLs from the forward stack. The actions of the user should produce the following results:

    Entering URL (via an address bar)
    Push current document onto backward stack
    Empty forward stack
    Recover URL from backward stack
    Push current document onto forward stack
    Pop backward stack
    Load popped URL as current document
    Load URL from forward stack
    Push current document onto back stack
    Pop forward stack
    Load popped URL as current document
    Additional Rules
    A new Window has empty stacks
    Popping an Empty Stack is not fatal

    Programming isnt my strongest skill and wanted to know where to start off with doing this and what kind of code to use.


  2. #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,947 Times in 4,908 Posts
    If you are supposed to do this in the browser, then you only have one real choice for "kind of code": JavaScript.

    Maybe you should start by creating a LIFO in Javascript code?
    Be yourself. No one else is as qualified.

  3. #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    London, England
    Thanked 2,700 Times in 2,676 Posts
    This may point you in the right direction:-


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts