VedNig

Can JavaScript be used for Dynamic Webpages?

Well, to tackle that I would like to say no , in short. But, it is nice enough for small functions and making immediate changes to a page such as for using as a remote controller with limited features but it can’t be the car itself.

So,

The main reason in this is JavaScript’s DOM objects and how its engines renders them. When you run functions on simple HTML pages it acts perfectly fine which is where this ‘*fine line*’ ends.

If there is a page which loads HTML DOM objects after the page is loaded(in terms of called/requested) JavaScript has two tags namely defer and async .

Although these tags help in providing somewhat functionality when loading a script from a source i.e. when using a src tag . They are not functional in an embedded script. Even if you are able to use it using src tag. They run in accordance to the page not the content you’ll need to add from a different source such as Redis,Firebase, MongoDB or Mysql.

And at the same time running the script or providing the srcipt on the same page will lead to errors. Main Cause ? The DOM’s .

So, in dynamic pages which is core part of Firbase’s RealTime Database’s or any other Realtime database’s goes out of the orbit. But that’s just for the basic JavaScript , any similar js which works on browser on load would also fail in providing and securing stability. But a backendframework js which has no relation with browser and its js rendering engine like Google’s V8, Microsoft’s Chakra, Mozilla’s Gecko,and Apple/kde’s kjs.

Any of the above engines provided a js would not perform exceptionally.

As I talked about, if you’re planning a real dynamic app you would have to choose Node.js.

And for small onloaded() page scripting use basic js.

:)👍😊

You can read more about DOM , Engines and Dynamic Pages.