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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -