SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I do this, with an image???

    I know how to make a "Back Button" using the following code:

    <FORM><INPUT style="FONT-WEIGHT: bold; BACKGROUND: yellow; COLOR: red; FONT-VARIANT: normal" onclick="javascript: history.go(-1)" type="button" value="Back to Previous Page">
    </FORM>


    But, how can I do the same thing when I'm using a graphic image instead of an html button?

    I just need to make a "back button" that takes you back to the previous page without using that page's URL. I guess that would be javascript that would do that
    .

  2. #2
    SitePoint Addict KelliShaver's Avatar
    Join Date
    Mar 2003
    Location
    Morehead, KY
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <a href="javascript:history.go(-1);"><img src="img.jpg" /></a>
    er.... I think the forum puts a space in javascript, but there shouldn't be one.

  3. #3
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's what I'm using and it's not working . . .

    <a href="java script:history.go(-1);"><IMG SRC="photos/button_back.gif" WIDTH="73" HEIGHT="32" BORDER="0" ALT="Back"></a>

    Anybody know why this isn't working?
    Thanks,
    .

  4. #4
    SitePoint Zealot
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    105
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've just checked this on my computer and it worked fine, although I had to remove the space between java and script otherwise it won't work

  5. #5
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK. That was it.
    I missed that somehow.

    Thanks for the tip!
    .


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
  •