How to refresh a page with jQuery by passing a parameter to URL

Solution 1:

You should be able to accomplish this by using location.href

if(window.location.hostname == "www.myweb.com")
   window.location.href += "?single";

Solution 2:

I would use REGEX with .replace like this:

window.location.href = window.location.href.replace( /[\?#].*|$/, "?single" );