In the Servers Book project 2.2 – Web Server – Control MultipleOutputs (Toggle Switches)
This line is used to send the update request when a slider is activated
xhr.open(“GET”, “/update?output=”+element.id+”&state=1”, true);
Why are the “+” signs requied to top and tail element.id?
The plus signs are concatenating the request with the string that will be returned by “element.id”.
So, imagine the element.id returns “2”, the request would be on the following URL:
I hope this is clear.
Thanks for that Sara, I hadn’t realised that the XMLHttpRequest() parameter was one continuous string, but I should have done – guilty of overthinking it!