JavaScript novice advice: don't worry about browser compatibility

  • 2020-03-30 01:35:02
  • OfStack

If I could go back in time, I would say to myself, "when I first learned JavaScript, I ignored the compatibility of DOM and BOM."

The situation I was in when I was a beginner

One of my biggest headaches when I first learned JavaScript was browser compatibility. In Firefox under the good code in IE can not be displayed, or in IE can display the code in Firefox error.

The responsibilities of the front-end development engineer include cross-browser development. So I took the time to learn about browser compatibility before I knew the language itself, which would make it harder for JS to learn. But code that is not compatible with major browsers cannot be used in real projects.

DOM and BOM compatibility issues for a while stalled my JavaScript learning. Lack of language understanding and code that runs only in certain browsers.

My advice

If you're just starting out with JavaScript and are in the same situation as I am, I recommend that you ignore the DOM and BOM compatibility when you're just starting out with JavaScript and spend more time understanding the language itself (ECMAScript). Write code only in a specific browser (Chrome/Firefox/Safari), and in practice use a mature JavaScript framework (jQuery, etc.). Rest assured, few companies will let new JS developers do front-end development with native JS.

What is the benefit of learning JS to ignore compatibility problems at the beginning

Reduce learning difficulty
Reduce frustration
Spend more time learning ECMAScript

When will you learn about JS cross-browser development

And when will browser compatibility be fixed?

When you're comfortable writing reusable code using a JavaScript framework (jQuery plug-ins or front-end controls), or when you're ready to develop your own JavaScript framework.

Some other Suggestions for JavaScript beginners

Never use the definitive guide to JavaScript as a primer
JavaScript advanced programming (third edition) should be used as a primer
Transfer and transfer, scope knowledge must be understood
Debugging tools must understand and use them, and learn to catch errors themselves. (chrome developer tool/Firebug)
Be patient again patience, dig deep to each knowledge point can learn more easily.

Above is my share of some hope to help you learn JavaScript, if you feel there is a misleading place please immediately point out.

Related articles: