I want to reload a page using JavaScript passing different parameters in URL.
My Page name is test1.aspx, I used:
window.location="test1.aspx?user=abc&place=xyz";
It's not working!
I want to reload a page using JavaScript passing different parameters in URL.
My Page name is test1.aspx, I used:
window.location="test1.aspx?user=abc&place=xyz";
It's not working!
Share Improve this question edited Mar 24, 2023 at 21:57 Brian Tompsett - 汤莱恩 5,88372 gold badges61 silver badges133 bronze badges asked May 15, 2012 at 13:44 Prasad JadhavPrasad Jadhav 5,21816 gold badges64 silver badges80 bronze badges 1- possible duplicate of How can I make a redirect page in jQuery/JavaScript? – Alex Commented May 15, 2012 at 13:46
3 Answers
Reset to default 14window.location
is an object. You need to access the href
property on it, like this:
window.location.href="test1.aspx?user=abc&place=xyz";
If you need to send dynamic value, then
var user = "abc";
var place = "xyz";
window.location.href = "test1.aspx?user=" + user + "&place=" + place;
window.location = "path page?user=" + $("#txtuser").val();