I've been raking my brain to try and understand what the Ampersand (&) in this function actually does:
function SwitchCheck() {
if (SW_form.SW1.checked) {
strSW1 = "&SW1=1";
}
else {
strSW1 = "&SW1=0";
}
}
Essentially what this function does is check's to see if a checkbox contained in a form named SW_Form is checked or not and assigned a value to variable strSW1 accordingly. My question is, what is the difference between saying strSW1 = "&SW1=1"; and strtSW1 = "SW1=1"; ?
thanks !!!
Thanks for all the reply's.
I think "6v6gt" is correct.
See the following url for additional context from the original code:
3/4 down the page is were the switches are discussed, and I can now see how this is related to the url that gets passed to the server on this line of the code in my specific application: request.open("GET", "ajax_inputs" + strSW1 + strSW2 + strSW3 + strSW4 + nocache, true);
I got confused and started down the rabbit hole of trying to understand why a pointer access operator was being used... Obviously, this was a bad assumption made on my part... Thanks for your help all...