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

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -