For beginners of JavaScript, it is recommended that you do not care about browser compatibility.
If I can go back to the past, I will tell myself this sentence: When I was a beginner in JavaScript, I ignored the compatibility between DOM and BOM. I first learned some basic knowledge and finally considered compatibility.
If I can go back to the past, I will tell myself this sentence: "We ignore the compatibility between DOM and BOM when learning JavaScript"
My initial situation
When I was a beginner in JavaScript, my biggest headache was browser compatibility. Put the good code under Firefox into IE and you will not be able to display it, or the code that can be normally displayed in IE will report an error in firefox.
Frontend development engineers are responsible for cross-browser development. Therefore, when I still don't know the JS language, I will spend time learning browser compatibility knowledge, which will make JS learning more difficult. However, codes that are not compatible with mainstream browsers cannot be used in actual projects.
The compatibility of DOM and BOM once slowed down my JavaScript learning. The language is not fully understood, and the code can only run in a specific browser.
My suggestions
If you are new to JavaScript and have the same situation as me, I suggest you ignore the compatibility between DOM and BOM when you are new to JavaScript, spend more time learning the language itself (ECMAScript ). Only code is written in a specific browser (Chrome/Firefox/Safari), and mature JavaScript frameworks (such as jQuery) are used in actual work ). Rest assured that few companies will allow new JavaScript beginners to use native JS for front-end development.
What are the benefits of ignoring compatibility issues when learning JavaScript?
Lower learning difficulty
Reduce frustration
Spend more time learning ECMAScript
When can I learn about JS cross-browser development?
When will the browser compatibility problem be solved?
When you are proficient in using JavaScript frameworks to write reusable code (jQuery plug-ins or front-end controls), or when you are preparing to develop a JavaScript framework yourself.
Other suggestions for beginners of JavaScript
Never use JavaScript as an entry-level book
JavaScript advanced programming (Third edition) should be used as an entry-level book
The knowledge of passing values, passing values, and scopes must be understood.
Debugging tools must be knowledgeable and versatile, and learn to capture errors by yourself. (Chrome developer tool/Firebug)
Patience and patience make it easier to learn every knowledge point.
The above are some of my shares. I hope you can help beginners with JavaScript. If you think it is misleading, please point it out immediately.