Google analytics code

Showing posts with label window.location. Show all posts
Showing posts with label window.location. Show all posts

Saturday, December 1, 2012

Javascript : Updating the search parameters with window.location

I ran into an issue with Firefox not navigating to a new address I set via windows.location. Here's an example of a url I was trying to set.


window.location = "?page=account&this=that&foo=bar";

There's a property on the location object called search. When updating a partial url this should be used.

window.location.search = "?page=account&this=that&foo=bar";