How to refresh a page with jQuery by passing a parameter to URL
I would use REGEX with .replace
like this:
window.location.href = window.location.href.replace( /[\?#].*|$/, "?single" );
You should be able to accomplish this by using location.href
if(window.location.hostname == "www.myweb.com")
window.location.href += "?single";