I defined a XMLHttpRequest in the Cloud9 IDE like this:
var xhr = new XMLHttpRequest();
But it prompted an error, saying ReferenceError: XMLHttpRequest is not defined.
Is XMLHttpRequest defined in Cloud9 IDE?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are running your javascript file via the ‘Debug’ button then it will be executed in node.js, which doesn’t contain
XMLHttpRequest(because it’s a browser feature).If the file you’re developing is a client side file, rather open the HTML page that references the js file via the ‘Preview’ button.
Otherwise, you can use node-XMLHttpRequest, that mimics the browser behavior, or request, which is the de-factor standard of doing requests to other services for nodejs.