Scripting Languages
Scripting Languages
How it Works
Browser
Web
1 - Request an HTML
Page
4 - Present HTML
Content
3 - Return HTML to
Web
Browser
Server HTML 2 - Retrieve requested
HTML
How Scripting Languages Work
Server runs
script
Client requests [ ASP / PHP / Ruby ]
page Script
Internet
Script
Completed HTML sent to builds
c lient HTML
c ode
• 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.
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.
Two Types
🞅 Server-side Scripting 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
Server side scripting means that all of the code is executed on
the server before the data is passed to the user's browser.
Serve
r
Server-side scripting
Step 2 – server executes the script, producing dynamic
HTML output
Serve
r
Server-side scripting
Step 3 – server returns dynamic HTML page to
browser
Serve
r
Client & Server side scripting
Web sites will often make use of both client-side and server-side
scripting.
Internet
2. Web server sends the HTML file to the
c lient
Client Machine
Web Server
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
Dynamic Web Pages
• The facebook homepage could be
Static WebPage
considered static because it has
a fixed layout and content. It
does not change.
Dynamic WebPage
• The only practical way to create
this page is by using a script
🞅 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.
Perl Python, Ruby
🞅 Ruby
🞅 Various blogs, data processing applications
🞅 Twitter, Shopify, Groupon, HUlu
🞅 Rely on volunteers to
🞅 Write documentation
🞅 Write test cases
🞅 Maintain the systems
🞅 Port to new platforms
🞅 Fix bugs
🞅 Implement libraries
🞅 Implement new features
ASP-PHP
🞅 Active Server Pages (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