I am receiving a JSON string from an ajax call and would like to convert a value to a predefined variable:
var predefined = \"hello world\"; var foo = {\"msg
var strings = {"predefined":"hello world"}; alert(strings[foo.msg]);
or e.g.
var messages = {}; messages.success_msg = "Your email is send successfully!"; // ... msg.text(messages[data.msg]).addClass("email-msg-success");