Using Pylons global variables with JavaScript (escaping brackets)
问题 I am trying to access a result in a dictionary held in a Python global variable within JavaScript. var selected = jQuery('.target option:selected').text() var list = "${c.persons_by_permission["+selected+"]}" If I directly access the dictionary without the using the variable: var list = "${c.persons_by_permission['stringID']}" Then the code works. However, when I am trying to use the variable to access the dictionary I get a syntax error (I believe its because of the curly braces). I have