Added sample scripts

Added sample scripts and fixed 2 bugs in the XMLHttpRequest.js