|
|
|
|
|
by imwilsonxu
5378 days ago
|
|
Pls correct my if I'm wrong. I see the idea:
1) Write htmls (with some rules, e.g. add '.actionable' class)
2) Library turn them to js codes. Benefits:
1) Write zero js codes.
2) Make basic and repetitive functionalities eaiser. But, just wondering, why don't you wrap codes which deal with basic and repetitive functionalities into js functions then reuse them, but write a library to turn htmls codes to js codes? My question is, html has its job and js has its, too. Is it a good idea to mix them? |
|
But:
- Joseph Perla's suggestions are usually good
- It just feels better to me... Maybe because it's easier to auto-generate html (e.g. from a Django template). Maybe because now many of our pages won't need any javascript. Maybe because all the custom logic is in one place rather than spread over the html and the javascript. Maybe because writing javascript is harder than html :)