{"action":"created","issue":{"url":"https://api.github.com/repos/nimojs/blog/issues/1","labels_url":"https://api.github.com/repos/nimojs/blog/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nimojs/blog/issues/1/comments","events_url":"https://api.github.com/repos/nimojs/blog/issues/1/events","html_url":"https://github.com/nimojs/blog/issues/1","id":58572977,"number":1,"title":"JavaScript初学者建议：不要去管浏览器兼容","user":{"login":"nimojs","id":3949015,"avatar_url":"https://avatars.githubusercontent.com/u/3949015?v=3","gravatar_id":"","url":"https://api.github.com/users/nimojs","html_url":"https://github.com/nimojs","followers_url":"https://api.github.com/users/nimojs/followers","following_url":"https://api.github.com/users/nimojs/following{/other_user}","gists_url":"https://api.github.com/users/nimojs/gists{/gist_id}","starred_url":"https://api.github.com/users/nimojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimojs/subscriptions","organizations_url":"https://api.github.com/users/nimojs/orgs","repos_url":"https://api.github.com/users/nimojs/repos","events_url":"https://api.github.com/users/nimojs/events{/privacy}","received_events_url":"https://api.github.com/users/nimojs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-23T11:18:17Z","updated_at":"2015-11-24T10:22:27Z","closed_at":null,"body":"JavaScript初学者建议：不要去管浏览器兼容\r\n====================================\r\n\r\n<!--_PAGEDATA\r\n{\r\n    \"title\": \"JavaScript初学者建议：不要去管浏览器兼容\",\r\n    \"githubissuesid\": 1,\r\n    \"createData\": \"2014-01-01\",\r\n    \"keywords\": \"前端开发入门教程,学习javascript,javascript教程,javascript入门\",\r\n    \"description\":\"给javascript新手的一些学习建议：初学 JavaScript 的时候无视 DOM 和 BOM 的兼容性\"\r\n}\r\n_PAGEDATA-->\r\n\r\n如果可以回到过去的话，我会告诉自己这句话：**\"初学 JavaScript 的时候无视 DOM 和 BOM 的兼容性\"**\r\n\r\n我初学时的处境\r\n--------------------\r\n在我初学 JavaScript 的时候最头痛的就是浏览器兼容问题。在 Firefox 下面好好的代码到 IE 就不能显示了，又或者是在 IE 能正常显示的代码在 Firefox 又报错了。\r\n\r\n前端开发工程师的职责就包括跨浏览器开发。所以我就**在还不了解 JS 这门语言本身的时候去花时间学习浏览器兼容知识**，**这样会让JS学习难度增加**。**但是不能兼容主流浏览器的代码不能用在实际项目中。**\r\n\r\n**DOM 和 BOM 的兼容性问题一度让我的 JavaScript 学习停滞不前**。语言理解不够，代码又只能在特定浏览器运行。\r\n\r\n我的建议\r\n------------\r\n如果你正初学 JavaScript 并有着和我一样的处境的话我建议你：**初学 JavaScript 时无视 DOM 和 BOM 的兼容性，将更多的时间花在了解语言本身（ECMAScript）**。只在特定浏览器编写代码（Chrome/Firefox/Safari），实际工作中使用成熟的 JavaScript 框架（jQuery等）。放心，很少有公司会让 JS 新手用原生 JS 做前端开发。\r\n\r\n### 学习 JS 初期无视兼容问题有什么好处\r\n1. 降低学习难度\r\n1. 减少挫败感\r\n1. 花更多的时间学习 ECMAScript\r\n\r\n什么时候学习JS跨浏览器开发知识\r\n---------------------------------------------\r\n\r\n而浏览器兼容问题留到什么时候解决呢？  \r\n当你能熟练使用 JavaScript 框架编写可复用的代码时（jQuery插件或前端控件），或当你准备自己开发一个 JavaScript 框架时。\r\n\r\n其他一些 JavaScript 初学者建议\r\n-----------------------------------------\r\n1. 无编程经验千万不要拿JavaScript权威指南当入门书籍\r\n2. 应该用JavaScript高级程序设计最新版本（目前是第三版）作为入门书籍\r\n3. 传值和传址、作用域知识必须理解\r\n4. 调试工具必须懂并多用，学会自己捕捉错误。（chrome developer tool/Firebug）\r\n5. 耐心再耐心，对每一个知识点深挖能学的更轻松。\r\n\r\n以上就是我的一些分享希望若能帮助到初学 JavaScript 的你，如果觉得有误导的地方敬请立即指出。\r\n\r\n[点此订阅博客](https://github.com/nimojs/blog/issues/15)\r\n\r\n若作者显示不是Nimo（被转载了），请访问Github原文进行讨论：[https://github.com/nimojs/blog/issues/1](https://github.com/nimojs/blog/issues/1)"},"comment":{"url":"https://api.github.com/repos/nimojs/blog/issues/comments/159220738","html_url":"https://github.com/nimojs/blog/issues/1#issuecomment-159220738","issue_url":"https://api.github.com/repos/nimojs/blog/issues/1","id":159220738,"user":{"login":"kujian","id":3055447,"avatar_url":"https://avatars.githubusercontent.com/u/3055447?v=3","gravatar_id":"","url":"https://api.github.com/users/kujian","html_url":"https://github.com/kujian","followers_url":"https://api.github.com/users/kujian/followers","following_url":"https://api.github.com/users/kujian/following{/other_user}","gists_url":"https://api.github.com/users/kujian/gists{/gist_id}","starred_url":"https://api.github.com/users/kujian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kujian/subscriptions","organizations_url":"https://api.github.com/users/kujian/orgs","repos_url":"https://api.github.com/users/kujian/repos","events_url":"https://api.github.com/users/kujian/events{/privacy}","received_events_url":"https://api.github.com/users/kujian/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T10:22:27Z","updated_at":"2015-11-24T10:22:27Z","body":"很新颖的建议，我也尝试一下忘掉兼容性的问题学习一下。"}}