Problem is that {1=blue, 5=Green} is not a valid object syntax, hence it has no clue what to do with it. When I read the German book, I am undefined too.
If you were to run this
var a = {1=blue, 5=Green}
it should give you the error
SyntaxError: missing : after property id
Proper JSON notation is
var a = {"1":"blue", "5":"Green"}
which JS knows how to process it.
If you return it as
var a = '{1=blue, 5=Green}';
It is a plain old string and plain old strings are just that.
So you had two choices, you either make it work from the server spitting out JSON, or you hire an interpreter on the client [that function I wrote] that converts a string over. You need to remember that you are trying to make Apple Juice from an Orange. It is impossible to make JavaScript do something that
Java understands. I wish my wife would understand that it is impossible for me to do the dishes, but she insists I make Apple juice from Oranges!
Eric