SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there any way of getting the document name of the last page.

    Hi guys

    Is there any way of getting the document name of the last page.

    I.E if I go from about.html to product.html is there anyway I can reference about.html in products.html

    Thanks in advance

    T

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you used a link you can examine the document.referrer, which holds
    the url of the link's page.

  3. #3
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I.E if I go from about.html to product.html is there anyway I can reference about.html in products.html
    No. The web is stateless, which means that everything that happened in the past is forgotten. Pages move into the past, when the page is unloaded. You can take steps to make information persist from page to page (e.g. cookies, query strings), but you can't reference anything on a page that unloaded from the browser(there is one minor exception).

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,875
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    If you need to know what page the current page was called from then you will have to pass that info as part of the link or in a cookie or by using a session. The document.referrer field is normally blanked out by security settings in your visitor's browser or firewall and so only those visitors who have low security set on their computer will have their privacy breached by always setting the referrer (no matter where they came from).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Zealot
    Join Date
    Sep 2005
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your replies guys much appreciated

    Ok looks I need to re-think this, guess it would help if I had some server side support not sure if my clients host has any 8>(

    Can you not have global variables or objects in java that can keep data between pages?

    Thanks again guys


Bookmarks

Posting Permissions

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