I have a Javascript function that sets a cookie and reloads the page from the server, I use this to handle changes to the selection criteria, it works well, however I just found a weird problem that I can't explain.
My function is as follows:
<script>
function reloadfunc(xcookiename,xvalue)
{
// Set cookie
document.cookie=xcookiename + "=" + xvalue+";path=/";
// Force scroll to top of page
document.cookie="scroll-to-top=Y;path=/";
// Reload Page from server
location.reload(true);
}
</script>
When I pass in a value of "{Blade Length|100mm+}" the cookie value ends up as "{Blade Length|100mm}" - the "+" has been stripped off for some reason.
Any thoughts on what I am doing wrong and how to fix it please?
I could understand if for some reason the "+" had vanished off the end of the string value, but it's in the middle of the string.