How To Append Parameters To Current Url And Reload With Javascript

Posted by Weston Ganger on September 20, 2016

One common task for javascript is to append parameters to a URL and reload the page. Heres a quick one liner to do so.

/* Add single parameter */ += "&my_param=foobar"

/* Add multiple parameters */ += "&my_field=foo&other_field=bar"

This will add the parameter and refreshYou will still see the original parameters but new ones will take precedence because it is last in the parameters list.

Related External Links:

Posted in Javascript and Tagged with javascript parameters 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts