SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2009
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Catch #anchor link onLoad

    Friends,

    I have been looking for days for a solution on this.

    What I want is for jQuery to do something when the page has loaded depending on the anchor in the URL.

    For example:

    domain.com/index.html#dothis
    domain.com/index.html#dothat
    domain.com/index.html#dosomethingelse

    Do these come under the onLoad event or something else?

    Any advice appreciated. Thanks.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,810
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Test the value stored in location.hash at whatever point in the processing where you need to know what follows the #
    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="^$">


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
  •