I am a HTML5/JS newbie and i am trying to understand what would be the correct way to separate my code. What i need is to send requests to my server, receive data and build my html files using this data (a table, for example).
Currently all my logic is in one JS file that does both the requests and the html building. It seems wrong to me. I would prefer to separate my code to one JS file that perform the requests and receives the data and another JS file that constructs the html. I wonder what are the best practices in JS and if i should separate the files, how do i include one JS file in another?
Aucun commentaire:
Enregistrer un commentaire