SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    button not workin

    why this button is not working
    Code JavaScript:
    <button onclick="javascript:history.go('http://yahoo.com')" >Yahoo</button>

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that you have the specified URI in your history list?

    Also, get rid of the 'javascript:' (the onclick attribute doesn't take a URI).

    You should probably prevent the default event action, too, since the default value for the type attribute for a <button> tag is submit.

    Code JavaScript:
    <button onclick="history.go('http://yahoo.com'); return false" >Yahoo</button>
    (And make sure the Yahoo URI is in your browser history.)
    Birnam wood is come to Dunsinane


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
  •