Architecture of a single-page JavaScript web application?

后端 未结 14 1493
迷失自我
迷失自我 2020-12-07 06:36

How should a complex single-page JS web application be structured on the client-side? Specifically I\'m curious about how to cleanly structure the application in terms of it

14条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 07:18

    The web application that I am currently working on uses JQuery and I would not recommend it for any large single page web application. Most frameworks i.e. Dojo, yahoo, google and others use namespaces in their libraries but JQuery does not and this is a significant drawback.

    If your web site is intended to be small then JQuery would be ok but if you intended to build a large site then I would recommend looking at all the Javascript frameworks available and deciding which one most meets your needs.

    And I would recommend applying the MVC pattern to your javascript/html and probably most of your object model for the javascript could be done as the json that you actually return from the server through ajax and the javascirpt uses the json to render html.

    I would recommend reading the book Ajax in action as it covers most of the stuff you will need to know.

提交回复
热议问题