ECMAScript/JavaScript Communications
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
XMLHttpRequest
XMLDOM
XMLHttpRequest
objectopen()
methodsend()
methodXMLDOM
object from the response
XMLDOM
object
open()
Method:
"GET"
or "POST"
)
false
for synchronous, true
for asynchronoussend()
Method:
setRequestHeader(header,value)
method can be used to add HTTP headers to the requestXMLHttpRequest
object will contain
the responseresponseXML
attribute
responseText
attribute
onreadstatechange
attribute must contain the function to calldocument.URL
(part of the DOM)window.location
(non-standard but supported)decodeURI()
and encodeURI()
functions can be used to convert from/to the standard encoding
(e.g., no spaces)lastIndexOf()
and
split()
methods that can be used to tokenize the
URL