After consulting several recommended tutorials on cookies, I came up with the following line for putting the value of the variable shipWeight into a simple cookie, for debugging purposes.
document.cookie = "shipWeightCookie="+shipWeight;
Unfortunately, it "breaks" the code. The function runs OK (although without the desired result) when this line is commented out.
Could someone tell me what is wrong with this syntax?
The examples in tutorials generally assume you want to write an explicit string value to the cookie rather than the value of a variable.