{"action":"opened","number":11,"pull_request":{"url":"https://api.github.com/repos/linggan100/notebook/pulls/11","id":65041343,"html_url":"https://github.com/linggan100/notebook/pull/11","diff_url":"https://github.com/linggan100/notebook/pull/11.diff","patch_url":"https://github.com/linggan100/notebook/pull/11.patch","issue_url":"https://api.github.com/repos/linggan100/notebook/issues/11","number":11,"state":"open","locked":false,"title":"添加状态页面保留功能","user":{"login":"xuexb","id":3872051,"avatar_url":"https://avatars.githubusercontent.com/u/3872051?v=3","gravatar_id":"","url":"https://api.github.com/users/xuexb","html_url":"https://github.com/xuexb","followers_url":"https://api.github.com/users/xuexb/followers","following_url":"https://api.github.com/users/xuexb/following{/other_user}","gists_url":"https://api.github.com/users/xuexb/gists{/gist_id}","starred_url":"https://api.github.com/users/xuexb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuexb/subscriptions","organizations_url":"https://api.github.com/users/xuexb/orgs","repos_url":"https://api.github.com/users/xuexb/repos","events_url":"https://api.github.com/users/xuexb/events{/privacy}","received_events_url":"https://api.github.com/users/xuexb/received_events","type":"User","site_admin":false},"body":"## 由来\r\n\r\n今天在某个群有人前端fe想看有没有哪个网站收集了一些干货，和一些博客的链接，我就果断的发了下`醉牛前端`，但由于我想让其直接看某个分类，却发现不能让其通过我分享的url直接打开目录的页面，由于我在想要不要通过`hash`来保留页面状态。\r\n\r\n## 处理思路\r\n\r\n修改导航的链接为`#hash`的锚点，绑定`hashchange`事件，统一接管渲染，页面默认显示loading，加载完再根据`hash`渲染下默认打开的页面，做到状态保留～\r\n\r\n但 [hashchange兼容性](http://caniuse.com/#feat=hashchange) 到ie8，个人感觉也没有问题～\r\n\r\n\r\n为了真实的看下效果，这里是我临时搭建的一个[预览地址](https://github.xuexb.com/notebook/index.html#blog)\r\n\r\nps: 导航中的`hash`起的名称可能不太友好～\r\n\r\n---\r\n\r\n当然只是个人看法哈～","created_at":"2016-04-02T15:46:39Z","updated_at":"2016-04-02T15:46:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd757c820a440800a452ac4ce93944b09df20989","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/linggan100/notebook/pulls/11/commits","review_comments_url":"https://api.github.com/repos/linggan100/notebook/pulls/11/comments","review_comment_url":"https://api.github.com/repos/linggan100/notebook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linggan100/notebook/issues/11/comments","statuses_url":"https://api.github.com/repos/linggan100/notebook/statuses/6e3b0bcb943123497491e8bd71f301024b161513","head":{"label":"xuexb:gh-pages","ref":"gh-pages","sha":"6e3b0bcb943123497491e8bd71f301024b161513","user":{"login":"xuexb","id":3872051,"avatar_url":"https://avatars.githubusercontent.com/u/3872051?v=3","gravatar_id":"","url":"https://api.github.com/users/xuexb","html_url":"https://github.com/xuexb","followers_url":"https://api.github.com/users/xuexb/followers","following_url":"https://api.github.com/users/xuexb/following{/other_user}","gists_url":"https://api.github.com/users/xuexb/gists{/gist_id}","starred_url":"https://api.github.com/users/xuexb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuexb/subscriptions","organizations_url":"https://api.github.com/users/xuexb/orgs","repos_url":"https://api.github.com/users/xuexb/repos","events_url":"https://api.github.com/users/xuexb/events{/privacy}","received_events_url":"https://api.github.com/users/xuexb/received_events","type":"User","site_admin":false},"repo":{"id":55299907,"name":"notebook","full_name":"xuexb/notebook","owner":{"login":"xuexb","id":3872051,"avatar_url":"https://avatars.githubusercontent.com/u/3872051?v=3","gravatar_id":"","url":"https://api.github.com/users/xuexb","html_url":"https://github.com/xuexb","followers_url":"https://api.github.com/users/xuexb/followers","following_url":"https://api.github.com/users/xuexb/following{/other_user}","gists_url":"https://api.github.com/users/xuexb/gists{/gist_id}","starred_url":"https://api.github.com/users/xuexb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuexb/subscriptions","organizations_url":"https://api.github.com/users/xuexb/orgs","repos_url":"https://api.github.com/users/xuexb/repos","events_url":"https://api.github.com/users/xuexb/events{/privacy}","received_events_url":"https://api.github.com/users/xuexb/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xuexb/notebook","description":"为广大同仁提供一个好的工具、资源平台","fork":true,"url":"https://api.github.com/repos/xuexb/notebook","forks_url":"https://api.github.com/repos/xuexb/notebook/forks","keys_url":"https://api.github.com/repos/xuexb/notebook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xuexb/notebook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xuexb/notebook/teams","hooks_url":"https://api.github.com/repos/xuexb/notebook/hooks","issue_events_url":"https://api.github.com/repos/xuexb/notebook/issues/events{/number}","events_url":"https://api.github.com/repos/xuexb/notebook/events","assignees_url":"https://api.github.com/repos/xuexb/notebook/assignees{/user}","branches_url":"https://api.github.com/repos/xuexb/notebook/branches{/branch}","tags_url":"https://api.github.com/repos/xuexb/notebook/tags","blobs_url":"https://api.github.com/repos/xuexb/notebook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xuexb/notebook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xuexb/notebook/git/refs{/sha}","trees_url":"https://api.github.com/repos/xuexb/notebook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xuexb/notebook/statuses/{sha}","languages_url":"https://api.github.com/repos/xuexb/notebook/languages","stargazers_url":"https://api.github.com/repos/xuexb/notebook/stargazers","contributors_url":"https://api.github.com/repos/xuexb/notebook/contributors","subscribers_url":"https://api.github.com/repos/xuexb/notebook/subscribers","subscription_url":"https://api.github.com/repos/xuexb/notebook/subscription","commits_url":"https://api.github.com/repos/xuexb/notebook/commits{/sha}","git_commits_url":"https://api.github.com/repos/xuexb/notebook/git/commits{/sha}","comments_url":"https://api.github.com/repos/xuexb/notebook/comments{/number}","issue_comment_url":"https://api.github.com/repos/xuexb/notebook/issues/comments{/number}","contents_url":"https://api.github.com/repos/xuexb/notebook/contents/{+path}","compare_url":"https://api.github.com/repos/xuexb/notebook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xuexb/notebook/merges","archive_url":"https://api.github.com/repos/xuexb/notebook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xuexb/notebook/downloads","issues_url":"https://api.github.com/repos/xuexb/notebook/issues{/number}","pulls_url":"https://api.github.com/repos/xuexb/notebook/pulls{/number}","milestones_url":"https://api.github.com/repos/xuexb/notebook/milestones{/number}","notifications_url":"https://api.github.com/repos/xuexb/notebook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xuexb/notebook/labels{/name}","releases_url":"https://api.github.com/repos/xuexb/notebook/releases{/id}","deployments_url":"https://api.github.com/repos/xuexb/notebook/deployments","created_at":"2016-04-02T14:50:23Z","updated_at":"2016-04-02T14:50:24Z","pushed_at":"2016-04-02T15:43:19Z","git_url":"git://github.com/xuexb/notebook.git","ssh_url":"git@github.com:xuexb/notebook.git","clone_url":"https://github.com/xuexb/notebook.git","svn_url":"https://github.com/xuexb/notebook","homepage":"https://linggan100.github.io/notebook","size":418,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"linggan100:gh-pages","ref":"gh-pages","sha":"96d09645cd34e9f9dc123be326c34d886a8dad5a","user":{"login":"linggan100","id":9244771,"avatar_url":"https://avatars.githubusercontent.com/u/9244771?v=3","gravatar_id":"","url":"https://api.github.com/users/linggan100","html_url":"https://github.com/linggan100","followers_url":"https://api.github.com/users/linggan100/followers","following_url":"https://api.github.com/users/linggan100/following{/other_user}","gists_url":"https://api.github.com/users/linggan100/gists{/gist_id}","starred_url":"https://api.github.com/users/linggan100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggan100/subscriptions","organizations_url":"https://api.github.com/users/linggan100/orgs","repos_url":"https://api.github.com/users/linggan100/repos","events_url":"https://api.github.com/users/linggan100/events{/privacy}","received_events_url":"https://api.github.com/users/linggan100/received_events","type":"User","site_admin":false},"repo":{"id":37769634,"name":"notebook","full_name":"linggan100/notebook","owner":{"login":"linggan100","id":9244771,"avatar_url":"https://avatars.githubusercontent.com/u/9244771?v=3","gravatar_id":"","url":"https://api.github.com/users/linggan100","html_url":"https://github.com/linggan100","followers_url":"https://api.github.com/users/linggan100/followers","following_url":"https://api.github.com/users/linggan100/following{/other_user}","gists_url":"https://api.github.com/users/linggan100/gists{/gist_id}","starred_url":"https://api.github.com/users/linggan100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linggan100/subscriptions","organizations_url":"https://api.github.com/users/linggan100/orgs","repos_url":"https://api.github.com/users/linggan100/repos","events_url":"https://api.github.com/users/linggan100/events{/privacy}","received_events_url":"https://api.github.com/users/linggan100/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/linggan100/notebook","description":"为广大同仁提供一个好的工具、资源平台","fork":false,"url":"https://api.github.com/repos/linggan100/notebook","forks_url":"https://api.github.com/repos/linggan100/notebook/forks","keys_url":"https://api.github.com/repos/linggan100/notebook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linggan100/notebook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linggan100/notebook/teams","hooks_url":"https://api.github.com/repos/linggan100/notebook/hooks","issue_events_url":"https://api.github.com/repos/linggan100/notebook/issues/events{/number}","events_url":"https://api.github.com/repos/linggan100/notebook/events","assignees_url":"https://api.github.com/repos/linggan100/notebook/assignees{/user}","branches_url":"https://api.github.com/repos/linggan100/notebook/branches{/branch}","tags_url":"https://api.github.com/repos/linggan100/notebook/tags","blobs_url":"https://api.github.com/repos/linggan100/notebook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linggan100/notebook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linggan100/notebook/git/refs{/sha}","trees_url":"https://api.github.com/repos/linggan100/notebook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linggan100/notebook/statuses/{sha}","languages_url":"https://api.github.com/repos/linggan100/notebook/languages","stargazers_url":"https://api.github.com/repos/linggan100/notebook/stargazers","contributors_url":"https://api.github.com/repos/linggan100/notebook/contributors","subscribers_url":"https://api.github.com/repos/linggan100/notebook/subscribers","subscription_url":"https://api.github.com/repos/linggan100/notebook/subscription","commits_url":"https://api.github.com/repos/linggan100/notebook/commits{/sha}","git_commits_url":"https://api.github.com/repos/linggan100/notebook/git/commits{/sha}","comments_url":"https://api.github.com/repos/linggan100/notebook/comments{/number}","issue_comment_url":"https://api.github.com/repos/linggan100/notebook/issues/comments{/number}","contents_url":"https://api.github.com/repos/linggan100/notebook/contents/{+path}","compare_url":"https://api.github.com/repos/linggan100/notebook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linggan100/notebook/merges","archive_url":"https://api.github.com/repos/linggan100/notebook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linggan100/notebook/downloads","issues_url":"https://api.github.com/repos/linggan100/notebook/issues{/number}","pulls_url":"https://api.github.com/repos/linggan100/notebook/pulls{/number}","milestones_url":"https://api.github.com/repos/linggan100/notebook/milestones{/number}","notifications_url":"https://api.github.com/repos/linggan100/notebook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linggan100/notebook/labels{/name}","releases_url":"https://api.github.com/repos/linggan100/notebook/releases{/id}","deployments_url":"https://api.github.com/repos/linggan100/notebook/deployments","created_at":"2015-06-20T12:48:29Z","updated_at":"2016-03-12T12:01:58Z","pushed_at":"2016-04-02T15:46:39Z","git_url":"git://github.com/linggan100/notebook.git","ssh_url":"git@github.com:linggan100/notebook.git","clone_url":"https://github.com/linggan100/notebook.git","svn_url":"https://github.com/linggan100/notebook","homepage":"https://linggan100.github.io/notebook","size":400,"stargazers_count":36,"watchers_count":36,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":11,"forks":5,"open_issues":11,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linggan100/notebook/pulls/11"},"html":{"href":"https://github.com/linggan100/notebook/pull/11"},"issue":{"href":"https://api.github.com/repos/linggan100/notebook/issues/11"},"comments":{"href":"https://api.github.com/repos/linggan100/notebook/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/linggan100/notebook/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/linggan100/notebook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linggan100/notebook/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/linggan100/notebook/statuses/6e3b0bcb943123497491e8bd71f301024b161513"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":0,"commits":4,"additions":68,"deletions":38,"changed_files":3}}