My code looks like this:
Do I need to somehow close the connection? It looks like send()
send()automatically closes the connection because I cannot execute send()send()twice.Is the error handling ok? When my internet connection was a bit unstable, I got the message "Error: 0". Zero sounds like a strange status code.
Note: For now, I'd like to stick with plain JavaScript, without jQuery or other frameworks.
Thank you very much.
UPDATE: Explanation/Contextcontext of the code:
The HTML page has a table. Each table row represents a dataset with an ID. The id of each row is "line" plus the dataset ID, e.g. "line1". Each Each table row has a link named "Solve" which calls the JavaScript function _solve(id) .