Skip to content

Instantly share code, notes, and snippets.

@mikelikesbikes
Created April 29, 2011 17:48
Show Gist options
  • Save mikelikesbikes/948697 to your computer and use it in GitHub Desktop.
Save mikelikesbikes/948697 to your computer and use it in GitHub Desktop.
// current window.location = "http://example.com/page"
var action = "http://example.com/beep#/stuff"
var params = "foo=bar&baz=qux"
window.location = action + encodeURIComponent("?" + params);
// browser result
// => http://example.com/beep?foo=bar&baz=qux#/stuff
// desired result
// => http://example.com/beep#/stuff?foo=bar&baz=qux
// any ideas...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment