{"action":"created","issue":{"url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/5","labels_url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/5/comments","events_url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/5/events","html_url":"https://github.com/aidanlister/jquery-stickytabs/issues/5","id":60533781,"number":5,"title":"Setting url hash on initial page load","user":{"login":"ahmerkureishi","id":3418003,"avatar_url":"https://avatars.githubusercontent.com/u/3418003?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmerkureishi","html_url":"https://github.com/ahmerkureishi","followers_url":"https://api.github.com/users/ahmerkureishi/followers","following_url":"https://api.github.com/users/ahmerkureishi/following{/other_user}","gists_url":"https://api.github.com/users/ahmerkureishi/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmerkureishi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmerkureishi/subscriptions","organizations_url":"https://api.github.com/users/ahmerkureishi/orgs","repos_url":"https://api.github.com/users/ahmerkureishi/repos","events_url":"https://api.github.com/users/ahmerkureishi/events{/privacy}","received_events_url":"https://api.github.com/users/ahmerkureishi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-10T17:07:08Z","updated_at":"2015-03-23T12:24:43Z","closed_at":null,"body":"Hey Aidan;\r\n\r\nThank you for this nifty little plugin - I was out to do something like this on my own for a project but then came across your post  through Google and thought it best to stick with your stickytabs.\r\n\r\nThe issue I am about to raise concerns the initial load event of the page. Here is the scenario:\r\n\r\nA user lands on a page with tabbable content and is served the default tab - although the url has no hash. The user switches to another tab and then wishes to return to the original tab via the back button. The page comes equipped with stickytabs to cover this very situation, so you'd expect it to work but it doesn't because the initial url had no hash.\r\n\r\nIn my solution, I was achieving it with this code inside the document's onload event:\r\n```javascript\r\nif (document.location.hash.length === 0) {\r\n  window.location.hash = $(\"#main-tablist a:first\").attr('href');\r\n}\r\n```\r\nDo you think this is the right way to go about it? Would you care to build something like this into your plugin?\r\n\r\nCheers!"},"comment":{"url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/comments/84970932","html_url":"https://github.com/aidanlister/jquery-stickytabs/issues/5#issuecomment-84970932","issue_url":"https://api.github.com/repos/aidanlister/jquery-stickytabs/issues/5","id":84970932,"user":{"login":"aidanlister","id":54896,"avatar_url":"https://avatars.githubusercontent.com/u/54896?v=3","gravatar_id":"","url":"https://api.github.com/users/aidanlister","html_url":"https://github.com/aidanlister","followers_url":"https://api.github.com/users/aidanlister/followers","following_url":"https://api.github.com/users/aidanlister/following{/other_user}","gists_url":"https://api.github.com/users/aidanlister/gists{/gist_id}","starred_url":"https://api.github.com/users/aidanlister/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidanlister/subscriptions","organizations_url":"https://api.github.com/users/aidanlister/orgs","repos_url":"https://api.github.com/users/aidanlister/repos","events_url":"https://api.github.com/users/aidanlister/events{/privacy}","received_events_url":"https://api.github.com/users/aidanlister/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T12:24:43Z","updated_at":"2015-03-23T12:24:43Z","body":"Yeah I think you're right. It's odd, because it used to work ...\n\nOn 23 March 2015 at 23:23, Matthias Althaus <notifications@github.com>\nwrote:\n\n> I'd say that hashchange isn't firing at all if it's set back to \"null\". I\n> compare it with popstate and the latter fires where hashchange doesn't on\n> the last step back.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/aidanlister/jquery-stickytabs/issues/5#issuecomment-84970757>\n> .\n>\n"}}