Search code examples
language-agnostic

What are Active Web Pages?


I am not able to understand the difference between active and dynamic web pages.

I know that Active web pages are first downloaded on the client machine and then executed. Dynamic web pages are executed on the server and then sent to the client.

But I am not able to correlate it with some real time example.

Kindly explain me the difference with some simple examples.

Also explain what is Applet and why it is active web page not dynamic.


Solution

  • As you said, dynamic is what's being executed on the server and then the result is being sent back to the client (browser). So for example when using PHP, your browser isn't able to execute PHP, so the server executes the PHP file and performs all logic in your code. The result will be an HTML file, which is then sent back to the client. The important thing to understand is that when the result is served to the client, the information in it won't change.

    An active web page is a page where the browser performs the logic instead of the server. So for example when you've got a page where you're showing share prices, then you want it to update e.g. every 5 seconds. A solution would be to use AJAX with JavaScript. In contrast to PHP, your browser is able to execute JavaScript, so it is happening without reloading the page. So with an active page, everything is happening inside your browser without the need to reload the page every time you want new information.

    An applet is an embedded application, like Flash or Java (not to be confused with JavaScript). To execute an applet, you most likely need a browser plugin. Because the applet is executed by the plugin and your browser, it is active and not dynamic (you don't need to request a new applet for information in it to change). The advantages of using an applet is that the programming language (like Java) has more possibilities than HTML. A lot of browser games are made with applets, but nowedays it is used less and less because we can achieve the same with techniques like JavaScript, HTML5 and WebGL.