Use XMLHttpRequest of JavaScript to send data to the background

1. Would like to send data to add to the FormData in (using XMLHttpRequest must add data to the FormData or it will protect the wrong)

2. A new XMLHttpRequest out

3. Use the open method to specify the way to request (post or get) and URL

4. Set the callback method

5. The most important step: use the send method (data is stored in the FormData inside the parentheses) to send data

Read More: