Web Programming Overview
Web Programming Overview
blog
Web
Programming
Hans-Petter Halvorsen
Web is the Present and the Future
With HTML5 powerful Web Applications can be made
Web Applications
Desktop Applications
Mobile Apps
History of the Web
• Internet (1960s)
• World Wide Web - WWW (1991)
• First Web Browser - Netscape, 1994
• Google, 1998
• Facebook, 2004
• Smartphones, 2007
• Tablets, 2010
O. Widder. (2013). geek&poke. Available: http://geek-and-poke.com
Firefox
Edge
Opera
The Web Browser
Chrome
Safari
Web Pages Examples
Web Development Environments
Microsoft:
• Visual Studio (Windows, a scaled version is in beta for MacOS)
• Visual Studio Code (Cross-platform, open-source)
Others:
• WebStorm (JavaSCript IDE, client-side development and server-side
development with Node.js, etc.)
• Eclipse
• Atom (free and open-source text and source code editor for macOS,
Linux, and Windows)
• Sublime
• ...
The Web Programming Triangle
Web
Programming
CSS JavaScript
Use CSS to specify the layout of web pages Use JavaScript to program
the behavior of web pages
JavaScript CSS
Web Programming
HTML ASP.NET
IIS XML
Web Services SQL
Web API
JQuery
PHP AJAX
Basic Web Programming
• HTML
• CSS
• JavaScript
ML
Server
Web
JavaScript
Web Architecture
Web Browser
Client
Web Server
Client-Server Example
Client
Web Browser
Response
Web Server
Request
Database
The code runs on the server and converted to Web Page (HTML)
HTML before sending to client (Web Browser)
http://www.digi.no/921119/under-halvparten-bruker-apache
HTML
<body>
Content of the document......
</body>
</html>
The History of HTML
https://www.w3schools.com/html/html5_intro.asp
HTML5 is supported in all modern Browsers
Edge Chrome
Opera
Firefox
Safari
CSS
h1 {
color: orange;
text-align: center;
}
p {
font-family: "Times New Roman";
font-size: 20px;
}
Three Ways to Insert CSS
There are three ways of inserting a style sheet:
• External style sheet (Recommended!!)
– An external style sheet is ideal when the style is applied to many pages. With an
external style sheet, you can change the look of an entire Web site by changing just
one file.
– An external style sheet can be written in any text editor. The file should not contain
any html tags.
– The style sheet file must be saved with a .css extension
• Internal style sheet
– An internal style sheet should be used when a single document has a unique style.
– You define internal styles in the head section of an HTML page, inside the <style>
tag
• Inline style
– An inline style loses many of the advantages of a style sheet (by mixing
content with presentation). Use this method sparingly!
JavaScript
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello JavaScript!";
}
</script>
</body>
</html>
JavaScript Frameworks
JavaScript is the de facto client-side programming language.
Typically you want to use a JavaScript Framework.
• http://getbootstrap.com
• http://www.w3schools.com/bootstrap/
JQuery
• http://www.w3schools.com/jquery/
TypeScript
• TypeScript is a free and open-source programming language
developed and maintained by Microsoft.
• It is a superset of JavaScript that compiles to JavaScript
http://www.typescriptlang.org
ASP.NET
Client
HTML JavaScript CSS
Web Server
Server-side
ASP.NET
C#/VB.NET
.NET Framework
ASP.NET – 3 different Development Models
Web Sites
Web
Web Pages MVC
Forms
ASP.NET
C#/VB.NET
.NET Framework
ASP.NET
ASP.NET supports three different development models:
2
The new .NET Core is a lightweight cross-platform 3
subset of the full .NET Framework 4
Controller
Updates Updates
https://en.wikipedia.org/wiki/PHP http://www.w3schools.com/php/
PHP
• PHP files can contain text, HTML, CSS, JavaScript, and PHP code
• PHP code are executed on the server, and the result is returned
to the browser as plain HTML
• PHP files have extension ".php"
https://en.wikipedia.org/wiki/PHP http://www.w3schools.com/php/
PHP Example
<!DOCTYPE html>
<html>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
AJAX
E-mail: hans.p.halvorsen@usn.no
Web: http://www.halvorsen.blog