In the early days of the World Wide Web, web pages were static documents that contained hypertext - essentially text that contained links (sometimes called hyperlinks) to other web pages or image files. It soon became possible to display images directly within the browser window along with the text, but web pages were still essentially static affairs. The only "interactive" elements were the hyperlinks.
Then, in 1993, the Common Gateway Interface (CGI) was introduced. CGI was a technology that allowed messages (called queries) to be sent from a web browser running on a client computer to a computer program (called a script) that ran on the web server. A query would typically consist of data entered into an HTML form by the user, and would be sent to the server when the user clicked on the form's "Submit" button.
The script would carry out any processing required, which often involved interrogating a database on the server to retrieve information requested by the client, and formulate a response. The response took the form of a dynamically generated HTML document, which was sent back to the client computer. The dynamically generated page would then be displayed by the client's web browser, replacing the page that originally generated the query.
Of course, all of this took time. Broadband connectivity would not be available to most Internet users for some years to come. When a user clicked on a button or link to generate a query, there would often be a considerable delay before the response appeared on their screen. Indeed, the very existence of CGI technology increased the workload on the average web server to such an extent that server response times generally were adversely affected.
The increased delays in response times led to the World Wide Web being referred to by many as the "World Wide Wait". The obvious answer, of course, was to increase connection speeds and improve the capacity of web servers to enable them to cope with the increased workload, but this would not happen overnight.
In the meantime, two things became apparent. The first was that scripts in general could do a lot more than just generate responses to database queries. They could, in theory at least, provide the same kind of functionality as a fully-fledged computer program running on the client computer. The second thing that became apparent was that at least some of this functionality could be carried out on the client computer, without the need to send queries to the server.