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 -

android - IBM Worklight 6.1 [Application Error] There was a network error (file:///android_asset/www/index.html) -