Author: Felix Tang
-
Dynamic content loading on web pages with Ajax & Express (3)
It is the third example using JQuery AJAX function and Express JS. Create a static HTML page called “log.html” and place it in the “public” folder of the project. Inside log.html, there are JavaScript code that executes when the “log.html” page is loaded. This code should use AJAX to send a request to the server’s… Read more
-
Dynamic content loading on web pages with Ajax & Express (2)
It is the second example using JQuery AJAX function and Express JS. The Express server will cycle through the colors ‘red’, ‘yellow’, ‘green’, and ‘blue’ when the route /colorword is accessed by AJAX. The colorword.html file displays a heading (<h1>) that initially has the color red. On page load, an AJAX request is sent to /colorword to retrieve the color, and… Read more
-
Dynamic content loading on web pages with Ajax & Express (1)
Dynamic content loading involves updating or loading content on a web page without the need for a complete page refresh. JavaScript plays a crucial role in enabling dynamic content loading by facilitating the retrieval and manipulation of data asynchronously. This approach offers several benefits: AJAX (Asynchronous JavaScript And XML) is a well-established method for achieving… Read more