Dynamic Webpages By Aniket N. Dhemre
Webpages •
A web page or webpage is a resource of information that is suitable for the World Wide Web and can be accessed through a web browser. This information is usually in HTML or XHTML format, and may provide navigation to other web pages via hypertext links.
•
Web pages may be stored on a local computer or on a remote web server. The web server may restrict pages to a private network, e.g. a corporate intranet, or it may publish pages on the World Wide Web. Web pages are requested and served from web servers using Hypertext Transfer Protocol(HTTP).
•
Web pages may consist of files of static text within the web server's file system (static web pages), or the web server may read files of computer code that instruct it how to construct the (X)HTML for each web page when it is requested by a browser (dynamic web pages).
Static versus Dynamic Webpage •
A website is collection of documents written in the HTML language. When a user looks at a website with a browser (e.g. Netscape), the browser is able to follow the instructions presented to it in HTML to make a website look a certain way.
•
if the user were to reload a static website, they would see the exact same content every time
•
In contrast to a static website, a dynamic website is one whose content is regenerated every time a user visits or reloads the site
Dynamic Webpages •
Dynamic Web pages can be defined as: (1) Web pages containing dynamic content (e.g., images, text, form fields, etc.) that can change/move without the Web page being reloaded OR (2) Web page that are produced on-the-fly by server-side programs, frequently based on parameters in the URL or from an HTML form.
•
Web pages that adhere to the first definition are often called Dynamic HTML or DHTML pages. Client-side languages like JavaScript are frequently used to produce these types of dynamic Web pages.
…continued •
Web pages that adhere to the second definition are often created with the help of server-side languages such as PHP, Perl, ASP/.NET, JSP, and other languages. These server-side languages typically use the Common Gateway Interface(CGI) to produce dynamic Web pages.
Client Side •
Client-side dynamic content is generated on the client's computer. The Web server retrieves the page and sends it as is. The Web browser then processes the code embedded in the page (normally JavaScript) and displays the page to the user.
•
The innerHTML property (or write command) can illustrate the "Client-side dynamic page" generation: 2 distinct pages, A and B, can be regenerated (by an "event response dynamic") as document.innerHTML = A and document.innerHTML = B; or "on load dynamic" by document.write(A) and document.write(B).
•
The problems with client-side dynamic pages are:
8. Some browsers do not support the language or they do not support all aspects (like write command and innerHTML property) and of the language. 9. The information cannot be stored anywhere but the user's computer, so it cannot really be used for statistics gathering. 10. Search engines are not able to run client-side languages and cannot crawl links generated by them. 11. Some users have scripting languages disabled in their browsers due to possible security threats.
Server Side •
Server-side dynamic content is a little bit more complicated.
3. 4. 5.
The browser sends an HTTP request. The server retrieves the requested script or program. The server executes the script or program which typically outputs an HTML Web page. The program usually obtains input from the query string or standard input which may have been obtained from a submitted Web form. The server sends the HTML output to the client's browser. Server-side has many possibilities for dynamic content, but the use of it can be a strain on low-end, high-traffic, machines. Some Web sites use the Robots Exclusion Standard to keep Web crawlers from accessing dynamic pages for this reason. If not properly secured, server-side scripts could be exploited to gain access to a machine.
6. 7.
•
Server-side has many possibilities for dynamic content, but the use of it can be a strain on low-end, high-traffic, machines.
•
If not properly secured, server-side scripts could be exploited to gain access to a machine.
Overview on DHTML •
Dynamic HTML is really just HTML with a few new elements plus access to those elements via a scripting language. The new elements give you more precise control over how your page looks and the new object model lets you manipulate those elements programmatically using scripts.
•
Originally, HTML was designed to use free-flowing layouts. You had little control over how your text and images were displayed on the page. This was in anticipation of pages being viewed on a variety of platforms and machines with different screen sizes and available system fonts.
•
Later, the
and tags were added to allow a little more control over content layout and style. But these still had their limitations. JavaScript was introduced to allowed for some manipulation of certain page elements, such as images and form inputs, through programming but was also somewhat limited. continued….
..continued •
Now, DHTML has added elements that give you precise control over the look of your page. These elements are:
•
Style Sheets let you define different styles for text presentation, such as color, margin size and fonts.
•
Content Positioning let's you determine exactly where elements of your page appear within the browser window. Elements can even overlap, be hidden or be moved dynamically.
•
Downloadable Fonts ensure that the font you choose for text will be used even if that font is not available on the client's machine. Browser Compatibility Both Netscape and Microsoft offer browsers that support DHTML but they differ in both accepted HTML syntax and scripting code.
Common Gateway Interface •
The Common Gateway Interface (CGI) is a standard protocol for interfacing external application software with an information server, commonly a web server. This allows the server to pass requests from a client web browser to the external application. The web server can then return the output from the application to the web browser.
•
The way CGI works from the Web server's point of view is that certain locations (e.g. http://www.example.com/ani.cgi) are defined to be served by a CGI program. Whenever a request to a matching URL is received, the corresponding program is called, with any data that the client sent as input. Output from the program is collected by the Web server, augmented with appropriate headers, and sent back to the client.
•
Because this technology generally requires a fresh copy of the program to be executed for every CGI request, the workload could quickly overwhelm web servers.
Thank You !
Related Documents