Users Contains user details username, password, email, profile_image and profile_image_small etc. ajaximage.php Contains PHP code. <? Db.php Database configuration file, modify username, password, database and base url values. New Tricks in XMLHttpRequest2. Introduction One of the unsung heros in the HTML5 universe is XMLHttpRequest.
Strictly speaking XHR2 isn't HTML5. However, it's part of the incremental improvements browser vendors are making to the core platform. I'm including XHR2 in our new bag of goodies because it plays such an integral part in today's complex web apps. Turns out our old friend got a huge makeover but many folks are unaware of its new features. This tutorial highlights some of the new features in XMLHttpRequest, especially those that can be used for working with files.
Fetching data Fetching a file as a binary blob has been painful with XHR. The old way to fetch an image: While this works, what you actually get back in the responseText is not a binary blob. Specifying a response format In the previous example, we downloaded the image as a binary "file" by overriding the server's mime type and processing the response text as a binary string. Xhr.responseType xhr.response Much nicer!