You do not write too much Javascript. As an example, the DML-homepage was set up using only two short HTML-pages. Each page contains about 100 lines of project specific Javascript-code, no HTML, only very few CSS. Behind the scenes you can use some libraries that do the work for you. So, the whole site with numerous pages was created using markdowns, the content is build dynamically after page load. All the routing is done dynamically while the page content is loaded.
Why do I call this a "framework"? Because it contains everything you need to build a web page or a SPA.
There are lot´s of examples on dev.to that show, that sources usually are very short.
This may server as an example:
HTML
<ul><li>Coffee</li><li>Tea</li><li>Milk</li></ul>
DML
ul(["Coffee","Tea","Milk"]);
But the approach is far more powerful than you can see from this few lines. Instead of building pages "by hand", you let Javascript do the work. Want to create 10000 buttons? Just write a loop to do the work:
for(leti=0;i<10000;i++)button("I am button Nr. "+i).onclick=()=>alert("This was button Nr. "+i)
Voila! with only two lines
you created 10000 buttons
you added some individual text *"I am button Nr. ..."
you created 10.000 individual event functions that display, which button was pressed
One library and a text editor is really all you need.
You think, 10000 functions may be too much, can we save some memory?
functiondoAlert(e){alert(e.srcElement.textContent)}for(leti=0;i<10000;i++)button("I am button Nr. "+i).onclick=doAlert
ok, this was three lines of code, but only one alert function for all buttons.
You will need to learn Javascript, but it is the only tool you will need. This pays back very soon!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
No, DML is VERY different.
You do not write too much Javascript. As an example, the DML-homepage was set up using only two short HTML-pages. Each page contains about 100 lines of project specific Javascript-code, no HTML, only very few CSS. Behind the scenes you can use some libraries that do the work for you. So, the whole site with numerous pages was created using markdowns, the content is build dynamically after page load. All the routing is done dynamically while the page content is loaded.
Why do I call this a "framework"? Because it contains everything you need to build a web page or a SPA.
There are lot´s of examples on dev.to that show, that sources usually are very short.
This may server as an example:
HTML
DML
But the approach is far more powerful than you can see from this few lines. Instead of building pages "by hand", you let Javascript do the work. Want to create 10000 buttons? Just write a loop to do the work:
Voila! with only two lines
One library and a text editor is really all you need.
You think, 10000 functions may be too much, can we save some memory?
ok, this was three lines of code, but only one alert function for all buttons.
You will need to learn Javascript, but it is the only tool you will need. This pays back very soon!