Programming OOP in Javascript - Properly

后端 未结 6 1391
旧时难觅i
旧时难觅i 2021-02-06 10:46

I\'m interesting in improving my javascript code to be properly OOP.... currently I tend to do something like this:

jQuery(document).ready(function () {
    Page         


        
6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-06 11:13

    I dont think it matters what language you use, good OOP is good OOP. I like to split up my concerns as much as possible by using an MVC architecture. Since JavaScript is very event based, I also use the observer design pattern mostly.

    Heres a tutorial you can read about MVC using jQuery.

提交回复
热议问题