6

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!

1

3 Answers 3

14

window.location is an object. You need to access the href property on it, like this:

window.location.href="test1.aspx?user=abc&place=xyz";
Sign up to request clarification or add additional context in comments.

Comments

2

If you need to send dynamic value, then

var user = "abc";
var place = "xyz";

window.location.href = "test1.aspx?user=" + user + "&place=" + place;

Comments

-1
window.location = "path page?user=" + $("#txtuser").val();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.