1 / 62

Java script and DHTML COMPSCI 381 Class Hour: 3:45pm – 5:00pm MW

Java script and DHTML COMPSCI 381 Class Hour: 3:45pm – 5:00pm MW. A little bit about the instructor. Assistant professor at UWW since August 2005. Graduated from the University of Connecticut (05 Class), Ph.D in Computer Science and Engineering.

tamika
Télécharger la présentation

Java script and DHTML COMPSCI 381 Class Hour: 3:45pm – 5:00pm MW

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. Java script and DHTMLCOMPSCI 381Class Hour: 3:45pm – 5:00pm MW

  2. A little bit about the instructor Assistant professor at UWW since August 2005 • Graduated from the University of Connecticut (05 Class), Ph.D in Computer Science and Engineering • Master of Computer Science from UW-Milwaukee (96-99) • Bachelor of Science from Hanoi University of Technology (86-91)

  3. Contact information nguyenh@uww.edu (fastest way to contact me) Office: McCutchan room 424 Office Hours: 9am – 11am MW or 1-2pm W or by appointment 262 472 5170

  4. Course Objectives Design a web interface for an web application. It needs to show samples, have links to description, price, warrant info, and shopping cart. It should allow users to pay by credit card…. Implement and test the interface

  5. Course detail - Topics Design, implement, an interface for web development Understand the requirement Apply skillfully Javascript & DHTML techniques Documentation Testing

  6. Course Evaluation

  7. Grade

  8. Getting started • Let’s overview HTML

  9. Assessment 1. The home page for a Web site is usually contained in a file named ___________ . a. index.html b. homepage.html c. default.html d. homepage.asp.

  10. Assessment 2. You are given an URL = http://www.awl.com/index.html. What is the host name? a. http:// b. www.awl.com c. index.html d. awl e. None of the above

  11. Assessment 3. Select the attribute in the following line of HTML code <table width=”350”>. a. width b. width=”350” c. Table d. None of the above

  12. Assessment 4. The variable bgcolor is use to set the background color. What variable would be used to indicate that a site had been previously entered? a. alink b. elink c. vlink d. zlink e. None of the above

  13. Assessment 5. Select the tag that starts all HTML documents. a. <BEGIN> b. <START> c. <HTML> d. <FIRST> e. None of the above

  14. Assessment 6. A link to another page begins with <a href. Select the name that best describes this tag. a. anchor b. pointer c. address d. a reference e. None of the above

  15. Assessment 7. Select the HTML code for the tag of a comment. a. <!- your comment -> b.<—your comment  c.< -- your comment -- > d. >!—your comment --< e. None of the above

  16. Assessment 8. Which part of an application formats and displays web pages? a. The information server b. The web browser c. The database server d. None of the above

  17. Assessment 9. The following CSS code creates a body tag with a black background and white text. BODY { background: black; text: white; } a. TRUE b. FALSE

  18. Assessment 10. The <H7> tag produces a heading with the largest font size. a. FALSE b. TRUE

  19. HTML overview • An HTML document consists of lines of text with embedded markup tags that specify Web-page formatting and links to other pages • Invented by Tim Berners-Lee at CERN 1989 • The birth of the World Wide Web

  20. http://www.w3.org/TR/REC-html40/ Protocol Host Machine Name URLs, Anchor Tags, and Document References

  21. URLs, Anchor Tags, and Document References • URL (Uniform Resource Locator) • A protocol, a mechanism used to fetch the desired object. • In this case: http (Hypertext Transfer Protocol). • The host machine, the computer that contains the requested object. • In this case, the host computer is www.w3.org. • Special host name for browser computer: localhost • The object name. • In this case, /TR/REC-html40/.

  22. Fundamentals of HTML • HTML, HEAD, Title, Body • Headings and paragraphs • Add emphasis to your text • Use various kinds of lists • Add links to other pages • Add images • Add links to other pages

  23. <HTML> and </HTML> • <HTML> The <HTML> tag is the first tag in your document. It tells the Internet browser that it is reading an HTML document (without it, the browser would think it was viewing a text document). • </HTML> This is the closing tag for the <HTML> tag. This should be the last line in your HTML document.

  24. <HEAD> and </HEAD> • <HEAD> Used to contain information such as title, style sheets • </HEAD>: This is the closing <HEAD> tag.

  25. <TITLE> and </TITLE> • <TITLE> and </TITLE> • It is used to make the title of the page. The title of the page will appear in the blue bar across the top of your active window Example: <TITLE> Basic HTML </TITLE>

  26. <BODY> and </BODY> • <BODY> and </BODY> We put all your text, images, and links between the opening and closing <BODY> tags.

  27. Headings and paragraphs • There are up to six levels of headers that can be used in your document, H1 through H6. Header 1 is the largest header and they get progressively smaller through header 6.

  28. Example • <h1>This is a header 1 tag</h1> This is a header 1 tag • <h2>This is a header 2 tag</h2> This is a header 2 tag

  29. Add emphasis to your text • Boldface This is a <b>boldface</b> tag. This is a boldface tag. • Italics This is an <i>italic</i> tag. This is an italic tag.

  30. Lists Numbered <ol> <li> list item 1 <li> list item 2 <li> list item 3 </ol>

  31. Lists Unumbered: <ul> <li> list item 1 <li> list item 2 <li> list item 3 </ul>

  32. Lists • Definition lists allow you to indent without necessarily having to use bullets. • <dl> <dt> This is a term <dd> This is a definition <dd> And yet another definition <dt> Another term <dd> Another definition </dl>

  33. Center • You can center text, images, and headings with the center tag: <center>This is a centered sentence</center> • The center tag automatically inserts a line break after the closing center tag.

  34. File names • Use lowercase file names • User proper extension: • *.html or *.htm

  35. Designing a web site • Determine the purpose of the web site • Determine the target audience • Determine numbers of pages • Sketch the site on paper

  36. Example of HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>My first Web site</title> </head> <body> <!-- Site navigation menu --> <ul> <li><a href="index.html">Home page</a> <li><a href="musings.html">Musings</a> <li><a href="town.html">My town</a> <li><a href="links.html">Links</a> </ul> <!-- Main content --> <h1>My first styled page</h1> <p>Welcome to my first page! </body> </html>

  37. Result

  38. Adding color <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>My first web page</title> <style type="text/css"> body { color: purple; background-color: #d8da3d } </style> </head> …… <body>

  39. Result

  40. Style sheet • Style sheets in CSS are made up of rules. Each rule has three parts: • the selector (in the example: “body”), which tells the browser which part of the document is affected by the rule; • the property (in the example, 'color' and 'background-color' are both properties), which specifies what aspect of the layout is being set; • and the value ('purple' and '#d8da3d'), which gives the value for the style property.

  41. Style sheet • Style sheets in CSS are made up of rules. Each rule has three parts: • the selector (in the example: “body”), which tells the browser which part of the document is affected by the rule; • the property (in the example, 'color' and 'background-color' are both properties), which specifies what aspect of the layout is being set; • and the value ('purple' and '#d8da3d'), which gives the value for the style property.

  42. Style sheet • Style sheets in CSS are made up of rules. Each rule has three parts: • the selector (in the example: “body”), which tells the browser which part of the document is affected by the rule; • the property (in the example, 'color' and 'background-color' are both properties), which specifies what aspect of the layout is being set; • and the value ('purple' and '#d8da3d'), which gives the value for the style property.

  43. Result

  44. Adding color <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>My first web page</title> <style type="text/css"> body { color: purple; background-color: #d8da3d } </style> </head> …… <body>

  45. Result

  46. Style sheet • Style sheets in CSS are made up of rules. Each rule has three parts: • the selector (in the example: “body”), which tells the browser which part of the document is affected by the rule; • the property (in the example, 'color' and 'background-color' are both properties), which specifies what aspect of the layout is being set; • and the value ('purple' and '#d8da3d'), which gives the value for the style property.

  47. Look at the example again <style type="text/css"> body { color: purple; background-color: #d8da3d } </style> SELECTOR value property

  48. Creating a Style rule • Step 1: Determine Selector (which identifies the elements you wish to format). Put { next to it Example: h1{ • Step 2: Determine property: value in which property is the name of CSS property that applies this format and value is one of valid options for that property Example: color:red • Step 3: Combine the results of step 1 and step 2 and put } at the end. If you have more than one property: value pairs, use semicolon (;) to separate them. Example: h1{color:red}

  49. Creating a selector • The type or name of elements For instance: body, paragraph • The context in which the element is found For instance: paragraphs in the middle of the web page • The class or id of an element For instance: the name of a paragraph in a web page.

  50. Examples • For the type or name of elements h2 {color:red} h1 {color: purple} • The context in which the element is found div#gaudi p {color:red} • The class or id of an element div#gaudi {color:red}

More Related