Like this article? You must log in first!

Incorporation of javascript, python, SQL, and HTML in website coding

Categories: Tech | Pubby Cash Received:  0 | Click to Award

A client sends a request to the server for information via port 80. The server renders HTML codes that will be parsed and displayed at the client end by a browser. That's how the web browsing works. Instead of rendering static HTML codes, dynamic web server is able to do the calculations based on the requests sent from the clients and returns the HTML codes with those calculation results. Compared to static websites, dynamic websites are more advanced, more informative, and more appealing to users. In order to make a website dynamic, a database has to be used with a querying language SQL. The database that python uses is 'SQLite', and there is a module 'SQLAlchemy' that streamlines the coding process for python programmers. Its syntax is different from the conventional SQL syntax, but is more intuitive and easy to use. After client sends a request, a server receives the request, queries the database, obtains the result, and sends back to the client. For the dynamic part (i.e. variables) of HTML that is sent out from the server, it is the coded inside double curly braces {{ }} within HTML, so that when the client browser sees it, it will automatically be interpreted and the stored value will be retrieved. However, this may not work if you would like to pass a variable into a javascript. Javascript can achieve a lot of fancy effects and are indispensable for modern web pages. To do that, the correct syntax should be {{ variable|tojson }}.


Published from: Pennsylvania US

Daily Deals


MECHANICSBURG WEATHER