jquery - Append a variable values with string using javascript -
i have below string.
window.location="./getdata?geo=abc&tab=xyz";
now have abc , xyz in var below:
var geo="abc"; var tab="xyz";
now how can append var above string instead of hard coding them inside string?
thanks!
try below:
var geo="abc"; var tab="xyz"; window.location="./getdata?geo=" + geo + "&tab=" + tab;
'+' symbol used concotinate string
Comments
Post a Comment