KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So I have the below code: var formData = new FormData(); formData.append("title", document.getElementById("title").value); formData.append("html",my_html); var xhr = new XMLHttpRequest(); xhr.open("POST", "https://www.mywebsite.com/index"); xhr.send(formData); xhr.onreadystatechange = function() { // If the request completed, close the extension popup if (req.readyState == 4) if (req.status == 200) window.close(); }; The server is supposed to send back a response in JSON format. How do I retrieve and store that in a variable?
Tags (comma-separated)
Save Edits
Cancel