可能重複:
Adding a parameter to the URL with JavaScript將參數添加到URL?
如果我想假設2個和ID值添加到URL。我怎樣才能使用JavaScript?
假設我們有URL:http://localhost/demo/
,那麼如何添加這2個參數。
可能重複:
Adding a parameter to the URL with JavaScript將參數添加到URL?
如果我想假設2個和ID值添加到URL。我怎樣才能使用JavaScript?
假設我們有URL:http://localhost/demo/
,那麼如何添加這2個參數。
"http://localhost/demo/" + "?name=" + escape(name_var) + "&id=" + escape(id_var)
一樣,但我怎麼可以添加我的代碼,以便它可以工作正確.... – rajesh 2010-06-23 10:39:54
如果你想重定向到使用JavaScript的位置,請: location.href="http://localhost/demo/?" + id + "=" + value + "&" + id2 + "=" + value2
如果只是想修改什麼在導航欄中你想
location.hash = id + "=" + value;
做像這樣: index.html?parameter1 = val1&parameter2 = val2 – 2010-06-23 10:32:04
這是你在追求什麼? http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript – 2010-06-23 10:32:15
是的,我想要像你提到的 – rajesh 2010-06-23 10:36:51