Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across.

Similar presentations


Presentation on theme: "Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across."— Presentation transcript:

1 web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across Internet Only programmer can alter the program Administrators can place limitations on user Potential overload of system Too many users at one time accessing programs Numerous languages Java Perl ASP PHP/FI C Can be complicated 8.02

2 web111a_chapt08.ppt CGI Programs (Server Side Programs) Common Uses Ordering Systems (shopping carts) Credit Card Processing Search Engines Password Protection Web site development by user on-line Client Side Programs Are executed by the browser Less complicated to write and maintain Can be tested locally – does not have to be on the internet Usually more responsive to the user Can do a lot of checking functions Is an interpretative language Most common languages JavaScript VBScript PHP/FI ASP

3 web111a_chapt08.ppt CGI Programs (Server Side Programs) Common Uses Ordering Systems (shopping carts) Credit Card Processing Search Engines Password Protection Web site development by user on-line Client Side Programs Are executed by the browser Less complicated to write and maintain Can be tested locally – does not have to be on the internet Usually more responsive to the user Can do a lot of checking functions Is an interpretative language Most common languages JavaScript VBScript PHP/FI ASP

4 web111a_chapt08.ppt Active Server Pages (ASP) code http://www.ffpc.org/http://www.ffpc.org/File Name: main.asp Note: HTML code embedded with the ASP code It is, at in Fenton, Michigan. = #12:00:00 AM# and Time Good Morning and welcome to The... = #12:00:00 pm# and time Good Afternoon and welcome to The... Good Evening and welcome to The...

5 web111a_chapt08.ppt JavaScript Simple to use Client side program Script Tag Identifies script type to browser JavaScript code url = name of external program Language = type of script to be executed

6 web111a_chapt08.ppt Page 8.07: Hiding the script from non JavaScript browsers <!– Hide from non-JavaScript browsers JavaScript program // Stop hiding from older browsers --> JavaScript: ignored by non-JavaScript browsers HTML: comment tag – a non-JavaScript browser will ignore all the statements between the tags //: JavaScript comment tag: A non-JavaScript browser will ignore A JavaScript browser would error as the verbiage is not JavaScript commands Note: no src attribute means the script is built into the HTML document, not coming from an external fi le

7 web111a_chapt08.ppt LAB: Figure 8-6, Page 8.08 Files are located at F:\Assign\Fulcher\web111a\tutorial.08 ------------------------------- JavaScript document.write(“text to the screen – no line return”); document.writeln(“text to the screen with a line return”); May include HTML in JavaScript LAB: Figure 8-7, Page 8.10 Writing a document to the screen 8.08

8 web111a_chapt08.ppt Working with Variables Variable: a named element in a program that stores information Store/gather information in one part of program to be used in another part Assignment format: (Page 8.11) variabl-ename = data-into-variable; Example: (Page 8.11 – 8.12) Year = 2003; document.write(Year); document.write(“The year is “ + Year); 8.11

9 web111a_chapt08.ppt Variable Types Numeric: numbers One decimal position allowed Dash (-) allowed to show negative Can do arithmetic with this type String: group of characters Enclosed in quotes (“) Letters of the alphabet Numbers (cannot do arithmetic) Boolean: logical one (yes) or zero (no) only Null: has no value assigned Declaring (creating) Variables Var name-of-variable = value-of-variable; Var Month; variable is null Var Month = “December”; creates and assigns Month = “December”; assigns a value LAB: Figure 8-8, Page 8.14 8.12

10 web111a_chapt08.ppt Date/Time Values Format Variable = DateObject.JavaMethod(); Get current date information Variable = new Date(); Example: Today = new Date(); Now, each of the Date Methods can access the date information Figures 8-9, 8-10, Page 8.17 LAB: Figure 8-11, Page 8.18 8.16

11 web111a_chapt08.ppt Expressions and Operators Use Variables Values Operators Perform actions within an expression + Increment (add) + Join two elements + to Increment Var ThisMonth = today.getMonth()+1; + to Join elements document.write(“Only “ + DaysLeft + “ days until Christmas”); Arithmetic Operators Figure 8-13, Page 8.20 8.19 8.20

12 web111a_chapt08.ppt Expressions and Operators Assignment Operators Assign one element (or result) to another element = Most common element1 = element2; += Uncommon Used to concatenate string data Assignment Operators Figure 8-14, Page 8.22 8.21

13 web111a_chapt08.ppt Math object and Math Methods Objects: libraries of functions Method: a specific function in an object Math object A set/group of math functions built into the browser program Math method Specific program (function) inside the Math object to handle a specific operation Figure 8-15, Page 8.22 8.22

14 web111a_chapt08.ppt JavaScript Functions Series of commands that perform an action (program) function function_name(parameters) { javascript commands; } XmasDays Function Page 8.25 LAB: Figure 8-17 and 8-18, Page 8.27 8.23


Download ppt "Web111a_chapt08.ppt HTML: Section 8 JavaScript CGI Programs (Server Side programs) Common Gateway Interface Run on server Communicate with user across."

Similar presentations


Ads by Google