In javascript i am building up a string like this...
var txt = "{authenticationToken: 1, authenticated: 2, authenticationTokenExpiry: 3,sessionTimeoutMinutes: 4,userName: " + userName + "}";
This is later put through and eval statement like this...
var obj = eval('(' + txt + ')');
When this happenings I get a reference error saying the the value of the username variable is undefined.
Does anyone know the reason for this? Is it something simple that I am missing?