javascript - XMLHttpRequest syntax for photos -
according google's chrome getting started tutorial: https://developer.chrome.com/extensions/getstarted
i having difficulty understanding source code javascript function xhr request grab photos flickr
requestkittens: function() { var req = new xmlhttprequest(); req.open("get", this.searchonflickr_, true); req.onload = this.showphotos_.bind(this); req.send(null); },
i understand syntax of req.open, req.send,etc. why boolean true, placeholder, , null inserted? these necessary parameters request? can please explain or refer resources explain it?
thanks!
the best resource xmlhttprequest specification.
you can read there, that:
open method has following syntax:
open(method, url [, async = true [, username = null [, password = null]]])
can see: async argument optional , defaults true. in example can omitted.send method,
send([data = null])
, takes optional argument providing request entity body. defaults null , ignored when request method (so in case).
Comments
Post a Comment