Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding parameter to URL? [duplicate]

Possible Duplicate:
Adding a parameter to the URL with JavaScript

If I wanted to add 2 suppose name and id values to URL. How can I do that using JavaScript?

Suppose we have URL: http://localhost/demo/, then how to add these 2 parameters.

like image 227
rajesh Avatar asked Feb 23 '26 11:02

rajesh


1 Answers

If you're trying to redirect to a location with javascript, try: location.href="http://localhost/demo/?" + id + "=" + value + "&" + id2 + "=" + value2

If you just want to modify what's in the navigation bar

location.hash = id + "=" + value;

like image 105
Thomas Shields Avatar answered Feb 25 '26 23:02

Thomas Shields