Sei sulla pagina 1di 15

Scripting Languages

Diane Krebs
11-7-14
Overview

 How it works
 What are scripts
 Different Scripting Languages
 Web pages & scripts
 Conclusion
How it Works

:
1 - Request an HTML Page
Web
Browser 4 - Present HTML Content

Web 3 - Return HTML to Browser


Server
 HTML 2 - Retrieve requested HTML
How Scripting Languages Work

Server runs script

Client requests page [ ASP / PHP / Ruby ]


Script
Internet
Script builds
Completed HTML sent to client HTML code

Web Server HTML ready to send


HTML Code
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.
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

 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
Static Web Pages
1. Client requests page

Internet
2. Web server sends the HTML file to the client

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.

• After Login results page however


is dynamic. This means its
content can be changed.

Dynamic WebPage
• 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.
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.
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
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

 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
JavaScript
 JavaScript
 Java and 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
JavaScript and HTML page
Tells where the JavaScript starts
<html>
<body>
<script type=“text/javascript”>
document.write(“Hello World!”);
</script>
Commands for writing output to a page
</body>
</html> Tells where the JavaScript ends

This code produce the output on an HTML page:


Hello World!
Conclusion

 Scripting languages make the web development work


 Easier
 Faster
 Best utilization of resources

 http://www.w3schools.com/html/html_scripts.asp
Questions

Potrebbero piacerti anche