Presentation is loading. Please wait.

Presentation is loading. Please wait.

Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.

Similar presentations


Presentation on theme: "Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT."— Presentation transcript:

1 Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT

2 Course contents  HTML, HTML5  CSS, CSS2, CSS3  Javascript, JQuery  Responsive Web Design  Being prepared for multiple device types Jaana Holvikivi27.1.2013

3 A sample HTML document This is a sample HTML document HTML: Basic structure

4 A sample HTML document HTML document This is a sample HTML document Created by JHH: 2013

5 HTML – element markup link: Search engine Start, close element space attribute="value" image: empty element Space stripped (breaks, tabs, enter)

6 7.6 Tables: Symmetrical structure!! cell1 cell 2 1

7 J.Holvikivi Scripts and styles on an HTML page HTML STYLE HEAD BODY Javascript SCRIPT STYLEsheet Javascript file

8 Page requests on the Web Internet User workstation Browser: HTML, scripts Database server HTTP request Server HTML pages Program Server CGI HTTP: HTML pages PHP JavaASP SQL Oracle

9 Page requests: XMLHTTPRequest User workstation Browser: Capture event/ Update page Database server XMLHTTPRequest (asynchronous) Server Application (PHP, Java, XSLT, ASP): Request readyState response SQL XML Ajax engine: Create server Request Send Monitor status Get response Process returned data Returned data

10 Javascript and document structure

11 EVTEK J.Holvikivi11 Javascript  Javascript is always downloaded from the server to the client  Either as a file reference  Or embedded in HTML  Javascript is executed on client side.  Less load on server  Example: checks on form input (numeric fields, dates, required fields)  Javascript understands the structure of the HTML page (document); DOM

12 J.Holvikivi12 HTML document  Javascript can recognize the tree structure This is a test page Below is a table... row 1 cell 1 row 1 cell 2 row 2 cell 1 row 2 cell 2

13 J.Holvikivi13 Tree of the page ’This is a test page’ ’Below is a table’ data datadata

14 J.Holvikivi14 Document Object Model (DOM)  Used by many programming languages (php, Java, C#, C++, Javascript…)  and understood by browsers (Firefox, IE, Chrome, Safari)  XML -document is a collection of nodes that make a hierarchical tree structure  The hierarchy is used in navigating the tree to locate information  Inefficient use of memory: the tree structure is created in the memory  DOM enables adding, moving, deleting and changing of nodes

15 J.Holvikivi15 Document tree Ancestor Parent / ancestor SiblingNode Child /descendantAttribute Descendant Namespace

16 J.Holvikivi16 Processing of the tree  Start with the root node ( document-object)  Element properties  firstChild  lastChild  nextSibling  parentNode  Methods to navigate the tree in Javascript  getElementByID(id)  getElementsByName(name)  getElementsByTagName(name)  getAttribute(name)


Download ppt "Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT."

Similar presentations


Ads by Google