Chapter 13
The third, and optional, parameter of
XMLHttpRequest.openis a Boolean value. Setting this totrue, the default, the request is asynchronous; setting it tofalsemakes the request synchronous.After getting a reference to the
XMLHttpRequestobject and opening it, assign the callback function through theonReadyStateChangeproperty.The
XMLHttpRequestobjectâsreadyStateproperty needs to have a value of 4 for completed; the request objectâs HTTP status property should be 200 for a successful service request.Here are the three formats: HTML, which can be immediately added to the page without any formatting; XML, which can be formatted with XSLT; and JSON, which can be used in a
evalfunction call to create a web structure ready for processing.From the Google Maps documentation, create a new
GIconobject and populate its properties. Then use the object when creating the newGMarkerobject:var icon = new GIcon(ââ); icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png"; icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GPoint(6, 20); icon.infoWindowAnchor = new GPoint(5, 1); ... marker = new Gmarker(point,icon);
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access