1 / 12

16 – Web applications: HTML and Client-side code

16 – Web applications: HTML and Client-side code. Session Aims & Objectives. Aims To introduce the fundamental ideas involved in web applications Objectives, by end of this week’s sessions, you should be able to: create a static web page, using HTML add dynamic functionality, using VB Script.

wood
Download Presentation

16 – Web applications: HTML and Client-side code

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 16 – Web applications: HTML and Client-side code

  2. Session Aims & Objectives • Aims • To introduce the fundamental ideas involved in web applications • Objectives,by end of this week’s sessions, you should be able to: • create a static web page, using HTML • add dynamic functionality, using VB Script

  3. Web Hardware and Software network connection Client Server Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache)

  4. Request-Response Cycle <html> <head> <title>Mark Dixon's web site</title> </head> <body background="BackGround.JPG"> <font size=+3><center><b><p>Mark Dixon's web site</b></center> <font size=+2> <p>Welcombe to my web server. Please select from the following list: <ul> <li><a href="./Soft131/Index.htm">Soft131: Introduction to programming for Multimedia and Internet applications.</a> </ul> </font> </body> </html> Response Request http://mdixon.soc.plym.ac.uk/ Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache)

  5. HTML • Hyper-Text Markup Language • text files • edited with notepad • with tags, e.g. • bold: <b>This will be in bold</b> • italic: <i>This will be in italic</i> • work like brackets • start/open <b> • end/close </b> • reference: http://www.willcam.com/cmat/html/crossref.html

  6. HTML page - Structure <html> <head> <title>Test</title> </head> <body> <p> This is a test <b>page</b>. </body> </html> head (info) body(content)

  7. Example 1: Intro page <html> <head> <title>Mark Dixon's web site</title> </head> <body background="BackGround.JPG"> <font size=+3><center><b><p>Mark Dixon's web site</b></center> <font size=+2> <p>Welcombe to my web server. Please select from the following list: <ul> <li><a href="./Soft131/Index.htm"> Soft131: Introduction to programming for Multimedia and Internet applications.</a> </ul> </font> </body> </html>

  8. Forms • Form • collection of input tags <HTML> <HEAD> <TITLE>Login</TITLE> </HEAD> <BODY> <FORM NAME="frmLogin"> <INPUT NAME="txtUserName" TYPE="input"><BR> <INPUT NAME="txtPassword" TYPE="password"><BR> <INPUT NAME="btnLogon" TYPE="button" VALUE="Logon" DISABLED="True"> </FORM> </BODY> </HTML>

  9. Dynamic processing (what) • HTML is static • identical on each load • very limiting • Dynamic processing • client-side (browser) • quicker (no request-response cycle) • insecure (view source) • limited (can't access server-side databases) • server-side (server application) • slower • more powerful

  10. Client-side processing (how) • Use <script> tags, to enclose • Script code • VB Script • Java Script <SCRIPT LANGUAGE=VBScript> <!-- MsgBox "Hello there!" --> </SCRIPT>

  11. Example 2: Form validation <HTML> <HEAD> <TITLE>Login</TITLE> <SCRIPT LANGUAGE=VBScript> <!-- Sub txtUserName_OnKeyUp() If Document.frmLogin.txtUserName.Value = "" Then Document.frmLogin.btnLogon.Disabled = True Else Document.frmLogin.btnLogon.Disabled = False End If End Sub --> </SCRIPT> </HEAD> <BODY> <FORM NAME="frmLogin"> <INPUT NAME="txtUserName" TYPE="input"><BR> <INPUT NAME="txtPassword" TYPE="password"><BR> <INPUT NAME="btnLogon" TYPE="button" VALUE="Logon" DISABLED="True"> </FORM> </BODY> </HTML> Login

  12. Reference • Inputs • Text • Password • Button • Submit • Events • OnClick • OnKeyUp • OnMouseOver

More Related