I have below string.
window.location="./getdata?geo=abc&tab=xyz";
Now i have abc and xyz in var as below:
var geo="abc";
var tab="xyz";
Now how can i append var with above string instead of hard coding them inside a string?
Thanks!
Try,
window.location="./getdata?geo="+ geo +"&tab=" + tab;
And also please read this to know more about how to do concatenation in Javascript
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With