MVC in vanilla JavaScript

Now I am where I really want to organize my code in such a way as to make it more scalable and manageable. I want to better understand the MVC architecture in javascript without using a framework.

So this is what I understand so far (please, please correct me if I am wrong):

Model : an organized structure of the content of sites / web applications (photo, copy, downloadable content, etc.) which also requires logic in manipulating the content. therefore, in javascript, the model can be a JSON object or a php file call that retrieves / updates the database, and the model logic can be functions that are responsible for parsing, regular expression and organization of the content so that it can then be transferred to the view?

View : user interface and visual representation of model data / content. its only task is to display the content and accept user input, if applicable?

Controller : so only the controller task should act as an intermediary between the model and the view? for example, if a view requires data, does it request a controller, which then goes to the model to get the data, and then sends it back to the view? and if there is any user input, the view sends it to the controller, which then sends it to the model, which is then updated, at which point the controller then informs the view that the model has been updated?

MVC , , , MVC javascript ( php, java, actionscript ..). )

+5
2

, , .

TODO mvc JS MV * Framework

JS mv *. ,

Vanilla JS Todo mv *

, MVC, , JS, (ember.js, backbone.js ..) , . todo - .

+3

, View Controller - - . . . , , , , , , ( ) ( ). , ...

, MVC, ;)

. MVC , , . ( ) . , MVC, . , . , .

+7

All Articles