I want to use a getJson call like this”
$.getJSON("cfc/getMember.cfc?method=getUser&returnformat=json&queryFormat=column",{"memberID":userID}, function(res,code)
the userID is stored as a cookie – so I thought I’d simply use:
function checkCookie(){
var userID=getCookie("UID");
}
Now (as I’m sure you cal tell) I’m new to javascript so that might be my problem – but I’m after some advice on how to use a cookie value in the getJSON call.
Thanks!
Simon
Assuming your
getCookie()function is already defined and correctly retrieves your cookies, then all you need to do is define theuserIDbefore you make the call to $.getJSON: