Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Script This is a first JavaScript example. This is a first JavaScript example.

Similar presentations


Presentation on theme: "Java Script This is a first JavaScript example. This is a first JavaScript example."— Presentation transcript:

1 Java Script This is a first JavaScript example. This is a first JavaScript example.

2 Hierarchical Objects Window Frame Location History Navigator document image form text XMLHttpRequest ??

3 Hierarchy Objects ObjectPropertiesMethodsEvent Handlers WindowdefaultStatus frames opener parent scroll self status top window alert blur close confirm focus open prompt clearTimeout setTimeout onLoad onUnload onBlur onFocus FramedefaultStatus frames opener parent scroll self status top window alert blur close confirm focus open prompt clearTimeout setTimeout none (The onLoad and onUnload event handlers belong to the Window object) Locationhash host hostname href pathname por protocol search reload replace none

4 Historylength forward go backnone NavigatorappCodeName appName appVersion mimeTypes plugins userAgent javaEnablednone documentalinkColor anchors applets area bgColor cookie fgColor forms images lastModified linkColor links location referrer title vlinkColor clear close open write writeln none (the onLoad and onUnload event handlers belong to the Window object.

5 imageborder complete height hspace lowsrc name src vspace width none formaction elements encoding FileUpload method name target submit reset onSubmit onReset textdefaultValue name type value focus blur select onBlur onCharge onFocus onSelect

6 Built-in Objects Array Data String

7 Built-in Objects ObjectPropertiesMethodsEvent Handlers Arraylengthjoin reverse sort xx none DatenonegetDate getDay getHours getMinutes getMonth getSeconds getTime getTimeZoneoffset getYear parse prototype setDate setHours setMinutes setMonth setSeconds setTime setYear toGMTString toLocaleString UTC none

8 Stringlength prototype anchor big blink bold charAt fixed fontColor fontSize indexOf italics lastIndexOf link small split strike sub substring sup toLowerCase toUpperCase Window

9 XMLHttpRequest Object Properties for Mozilla, Firefox, Netscape, Chrome PropertyDescription channelContains the channel used to perform the request. Read-only. readyStateContains the state of the request. Read- only. responseTextContains the response body as a string. Read-only. responseXMLContains the response body as XML. Read-only. statusContains the HTTP status code returned by a request. Read-only. statusTextContains the HTTP response status text. Read-only.

10 XMLHttpRequest Object Methods for Mozilla, Firefox, Netscape, Chrome Method overrideMimeType Description abort Aborts the HTTP request. getAllResponseHeaders Returns all the HTTP headers. getResponseHeader Returns the value of an HTTP header. openRequest Open / send / setRequestHeader Native (nonscript) method to open a request. OverrideMimeTypeOverrides the MIME type the server returns.

11 Opening XMLRequest Object open("method", "URL"[, asyncFlag[, "userName"[, "password"]]]) XMLHttpRequestObject.open(“GET”, datasource);

12 A in ajax stands for asynchronous handshaking function getData(dataSource, divID) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = callback() } function callback() {. }

13 Shortcut for callback() function getData(dataSource, divID) { if(XMLHttpRequestObject) { XMLHttpRequestObject.open("GET", dataSource); XMLHttpRequestObject.onreadystatechange = function() {. }

14 Ready state property

15 status

16


Download ppt "Java Script This is a first JavaScript example. This is a first JavaScript example."

Similar presentations


Ads by Google