@tim_g said in Dipping Toes Into Programming:
@scottalanmiller said in Dipping Toes Into Programming:
Have you written HTML by hand? If not, you should. It helps to make this more clear.
Yes i've written full plain HTML websites from scratch, I'm well versed in it, though it's been a while. I get HTML, that's easy.
That bit of HTML I gave before as an example, if you remove the javascript, you just see a blank page.
Now, with your explanations from above, it yet makes things even more clear.
So let's see if I have this right:
Above HTML displays a blank page, but one (combined with the others) of the pieces (i'm assuming molten.js
) loads via the <script> tag. This I'm familiar with too, back in the day I used already made javascripts on my sites to do cool things on pages.
So what you're saying is that molten.js is doing all the behind the scenes work on the server, and then outputting it's own HTML (what you see when the webpage loads), on top of that blank HTML page going on in index.html? I'm thinking of it in the context of acting like an iframe if you know what I'm getting at.
This is a SPA, which means all the logic, rendering and routing of the app is moved away from the server and into the client(client-side rendering). Molten.js is the app (the whole interface) bundled together (using webpack) and sent to you completely on your first request.
Even though the backend is using a python framework (cherrypy), you don't have to write any Python code at all to consume the REST API exposed by it. Basically the backend is only sending your browser JSON and nothing else after the first request.
I'm familiar with that as well then, in a way, as I have a PowerShell script that grabs all users from specified OUs plus some specified info as well as their AD picture, and outputs it to a .html file to be used as a company phone list. But in this case, the PowerShell script is generating the entire index.html file itself. Not being called and loading content after an existing page is already loaded.
This is more akin to server-side rendering, where the backend is completely in charge of the logic, the routing and rendering of the HTML templates. When using server-side rendering, each request for a new page you make on the client causes a page refresh which contains a pre-rendered HTML template as a response from the backend.