Welcome to TalkGraphics.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2000
    Location
    Leigh, Lancashire, UK
    Posts
    436

    Default

    I am using some small graphics on mys site for the following functions... Home, back and reload.

    The Home is easy to do as it just links back to my home page.

    However, I am stuck on the Back and Reload buttons.

    I know that NS supports the windows.back() function but I can't dind anything comparable for IE. Is there anything?

    Also how would I go about reloading a page?



    Michael Ward
    http://LeighCenturions.net

  2. #2
    Join Date
    Aug 2000
    Location
    Leigh, Lancashire, UK
    Posts
    436

    Default

    I am using some small graphics on mys site for the following functions... Home, back and reload.

    The Home is easy to do as it just links back to my home page.

    However, I am stuck on the Back and Reload buttons.

    I know that NS supports the windows.back() function but I can't dind anything comparable for IE. Is there anything?

    Also how would I go about reloading a page?



    Michael Ward
    http://LeighCenturions.net

  3. #3
    Join Date
    Aug 2000
    Location
    Las Vegas, NV
    Posts
    819

    Default

    Michael I'm not an expert, but I think you can use:
    window.history.back() and window.history.forward()
    as all browsers keep a history of visited pages.

    Mickie

  4. #4
    Join Date
    Oct 2001
    Location
    Sarasota, Florida, USA
    Posts
    62

    Default

    Here's an example of a script I used to ensure it worked in IE and Nutscrape:

    [a href="javascript:history.go[-1);"]
    [img src="name-of-your-button-image" onclick="javascript:history.back[1);"][/a]

    The j-script in the "href" works in one browser, the "onclick" works in the other.

    Gary V.
    "I'm not an artist, but I play one on the internet!"

  5. #5
    Join Date
    Aug 2000
    Location
    Ingolstadt, Germany
    Posts
    358

    Default



    Avoid using JavaScript URLs. It'll go wrong in browsers with JS unavailable, and generate ugly errors if you try to use functions like "open link in new window" on it.</p>

    Gary's second example is better, but for best compatibility across browsers you'll want to put the onclick in an <a> element.</p>

    Also you don't need to put the 'javascript:' at the start of an event handler since it is explicitly JavaScript anyway - writing 'javascript:' in what is already JavaScript code just defines a new label called 'javascript', which is probably not what you want to do.</p><blockquote><code><a href="#" onclick="history.back(); return false;"><img src="back.gif" alt="Back"></a></code></blockquote>

    (Although... it's almost always a bad idea to add forward/backward buttons to a web page, since the browser already has perfectly good ones. You only risk confusing the reader, who may reasonably expect forward/back to step between pages in a sequence).</p>

  6. #6
    Join Date
    Aug 2000
    Location
    NS Canada
    Posts
    212

    Default

    And further to Andrew's parenthesis addendum - a rule of thumb is no major site navigation in buttons as those that surf without images or more increasingly, through WAP won't be able to see what's going on at all. Sometimes the old adage "KISS" makes the best sense after all! [img]/infopop/emoticons/icon_smile.gif[/img]

    cfn ... Jen
    Jen Worden
    Web Developer
    www.meadoworks.com
    cfn ... Jen

    Jen Worden
    Web Developer
    www.meadoworks.com

  7. #7
    Join Date
    Aug 2000
    Location
    Leigh, Lancashire, UK
    Posts
    436

    Default

    Thanks for the tips guys!

    I am thinking about removing these buttons, but the placement of something in that area of similar looks is essential to my design... I will have a think about it, but thanks for the tips nevertheless. [img]/infopop/emoticons/icon_biggrin.gif[/img]



    Michael Ward
    http://LeighCenturions.net

  8. #8

    Default

    I agree with what Jen says regarding button navigation as if you have graphics turned off it is difficult to navigation using a button.

    However you can have your cake and eat it simply by using buttons for people who have graphics but always add simple text links, with the same name and url as the buttons, somewhere on the page for those who don't/can't use images.

    Su
    "If there was anything that depressed him more than his own cynicism, it was that quite often it still wasn't as cynical as real life." - Terry Pratchett, Guards! Guards!

 

 

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
  •