{"id":17438254,"url":"https://github.com/blixt/js-hash","last_synced_at":"2025-03-01T12:32:26.861Z","repository":{"id":137380477,"uuid":"621780","full_name":"blixt/js-hash","owner":"blixt","description":"A JavaScript library that keeps track of the history of changes to the hash part in the address bar.","archived":false,"fork":false,"pushed_at":"2013-11-17T23:58:00.000Z","size":164,"stargazers_count":70,"open_issues_count":2,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-21T10:12:34.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://blixt.org/js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blixt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-04-21T15:30:46.000Z","updated_at":"2021-12-13T08:06:07.000Z","dependencies_parsed_at":"2023-04-26T07:02:45.494Z","dependency_job_id":null,"html_url":"https://github.com/blixt/js-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blixt","download_url":"https://codeload.github.com/blixt/js-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":220050311,"owners_count":16588358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-17T12:04:20.292Z","updated_at":"2024-10-17T12:04:20.760Z","avatar_url":"https://github.com/blixt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hash handler\n\n## Information\n\nA JavaScript library that keeps track of the history of changes to the hash\npart in the address bar.\n\nA callback function, \"handler\", is used to handle changes. The function will\nbe called once when the library is initialized (usually when the page has\nfinished loading) and then whenever the hash changes.\n\n**Warning** for Internet Explorer 7 and below: If an element on the page has\nthe same ID as the hash used, the history will get messed up.\n\nDoes not support history in Safari 2 and below.\n\n## Example\n\n    function handler(newHash, initial) {\n        if (initial)\n            alert('Hash is \"' + newHash + '\"');\n        else\n            alert('Hash changed to \"' + newHash + '\"');\n    }\n    Hash.init(handler);\n    Hash.go('abc123');\n\nThe `initial` argument is a boolean that indicates whether the handler was\ncalled for initial state by `Hash.init` (value will be `true`), or due to\nan actual change to the hash (`false`).\n\n### jQuery plugin\n\nAlso included is a jQuery plugin that simplifies the use of the Hash library.\n\n#### Example\n\n    // Add events before calling init to make sure they are triggered for\n    // initial hash value.\n    $('div#log').hashchange(function (e, newHash) {\n        $(this).prepend('\u003cp\u003eNew hash: \u003cb\u003e\"' + newHash + '\"\u003c/b\u003e\u003c/p\u003e');\n    });\n    // Initialize.\n    $.hash.init();\n    $.hash.go('abc123');\n    // Changes hash when the anchor is clicked. Also automatically sets the\n    // href attribute to \"#def456\", unless a second argument with a false\n    // value is supplied.\n    $('a#my-anchor').hash('def456');\n\n## MIT license\n\nThis project is licensed under an MIT license.\n\nCopyright (c) 2009-2010 Andreas Blixt \u003candreas@blixt.org\u003e\n\nhttp://www.opensource.org/licenses/mit-license.php\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblixt%2Fjs-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblixt%2Fjs-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblixt%2Fjs-hash/lists"}