This document discusses scripting languages and how they are used to create dynamic web pages. It begins by explaining how scripting languages work by generating HTML code on the server that is then sent to the client's browser. It then discusses different types of scripting languages, including server-side languages like PHP and ASP that can leverage server resources, and client-side languages like JavaScript that run in the browser. Popular scripting languages are also highlighted, such as Perl, Python, Ruby, PHP and JavaScript. The document concludes by noting how scripting languages make web development easier, faster and allow for better utilization of resources.
I n te r n e t
Client requests page
Completed HTML sent to client
Web Server
Client Machine
With Web Browser
• The script, written by the website developer, generates the HTML code of the page requested.
• The HTML code is not actually a file. The code is actually held in the server’s memory until it is
sent directly to the client.
• A script may run other scripts, depending on its function. It will however still only give one
end result.
• A website does not have to be completely made up of either scripts or HTML files. It can use a
combination of the two.
Script builds
HTML code
HTML ready to send
Server runs script
[ ASP / PHP / Ruby ]
Script
HTML Code
How Scripting Languages Work
5.
What Are Scripts?
A new style of programming language different from system
programming languages
It does not matter what scripting language a website uses
because there are no compatibility issues with clients’ web
browsers.
Designed as glue language or system integration language
A single statement can execute huge number of machine
instructions
Can create dynamic web pages
Change based on user input
The client only ever sees the final HTML generated by the script
and not the script itself.
Scripts often finish running in several milliseconds. Most web
servers can run many scripts simultaneously with a minimal
performance hit.
6.
Two Types
Server-sideScripting Language
Can use huge resources of the server
Complete all processing in the server and send plain
pages to the client
Reduces client-side computation overhead
Client-side Scripting Language
Does not involve server processing
Complete application is downloaded to the client browser
Client browser executes it locally
Are normally used to add functionality to web pages e.g.
different menu styles, graphic displays or dynamic
advertisements
7.
I n te r n e t
1. Client requests page
2. Web server sends the HTML file to the client
Web Server
Client Machine
With Web Browser
• A simple website is made up of one or more static HTML files. This means the page
content does not change.
• The only way to update a page is for the author to edit the file.
• This is fine for small websites or those that require little updating.
• Static pages will not work for websites that need to deliver lots of custom and up-to-
date content: e-commerce, auctions, blogs, search engines, online banking
Static Web Pages
8.
• The facebookhomepage could be
considered static because it has a
fixed layout and content. It does
not change.
• After Login results page however
is dynamic. This means its
content can be changed.
• The only practical way to create
this page is by using a script
• The user never sees the work a
script does, only the end result it
sends back to their browser.
DynamicWebPageStaticWebPage
Dynamic Web Pages
9.
Perl, Python, Ruby
Perl
Found on all Windows and Linux servers
Can handle text manipulation tasks
Excellent web scripting language
high-traffic websites that use Perl extensively
include Priceline.com, Craigs List, IMDB
Python
Can be used as a script or a programming language
OOP language with a lot of features which support of web
applications as well as software programs
Industrial Light & Magic: "The Phantom Menace", "The Mummy
Returns"
Walt Disney Feature Animation: uses scripts in their animation
production system.
Shopzilla: configuration management and deployment, automated
testing and internal tool development.
10.
Perl Python, Ruby
Ruby
Various blogs, data processing applications
Twitter, Shopify, Groupon, HUlu
Ruby, Perl, Python, etc., are all open source
Rely on volunteers to
Write documentation
Write test cases
Maintain the systems
Port to new platforms
Fix bugs
Implement libraries
Implement new features
11.
ASP-PHP
Active ServerPages (ASP)
Server side scripting language
Developed by Microsoft
Good at connecting to Microsoft databases
Runs only on Microsoft servers
Microsoft.com, GoDaddy, Skype, NYTimes.com
PHP (Hypertext Pre-Processor)
Especially good at connecting to MySQL
Generate Dynamic content and good User Interface
Server side execution
Facebook, Wikipedia, Yahoo, Photo-bucket, &
WordPress
12.
JavaScript
JavaScript
Javaand JavaScript are two completely different
languages in both concept and design
Client-side & server-side scripting language
Enhance dynamics and interactive features of a web
page
Allows one to perform calculations, write interactive
games, add special effects, customize graphic
selections, create security passwords
used in millions of web pages
to improve the design
to validate forms
to detect browsers
to create cookies
13.
JavaScript and HTMLpage
<html>
<body>
<script type=“text/javascript”>
document.write(“Hello World!”);
</script>
</body>
</html>
This code produce the output on an HTML page:
Hello World!
Tells where the JavaScript ends
Tells where the JavaScript starts
Commands for writing output to a page
14.
Conclusion
Scripting languagesmake the web development work
Easier
Faster
Best utilization of resources
http://www.w3schools.com/html/html_scripts.asp