JoeBo747
asked on
Rest service Parameters
I need to construct and concatenate a dynamic parameter string for a json restservice if I have one value in the parameter it looks like:
var A = localStorage.getItem('acco unt');
return '{"account":"' + A + '"}'
This works and produces the value: {"account":"systems"}
I need to pass another parameter in the same string but am struggling with how to achieve this, the string should end up looking like:
{"account":"systems" , “password”:”abc123”}
I have
var A = localStorage.getItem('acco unt');
var P = localStorage.getItem('pass word');
What is the correct syntax to construct the string?
var A = localStorage.getItem('acco
return '{"account":"' + A + '"}'
This works and produces the value: {"account":"systems"}
I need to pass another parameter in the same string but am struggling with how to achieve this, the string should end up looking like:
{"account":"systems" , “password”:”abc123”}
I have
var A = localStorage.getItem('acco
var P = localStorage.getItem('pass
What is the correct syntax to construct the string?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Kaufmed,
I am fairly new to jquery and could not quite work out the correct syntax your example is exactly what I needed.
Thanks,
Joe
I am fairly new to jquery and could not quite work out the correct syntax your example is exactly what I needed.
Thanks,
Joe
Open in new window