As for your question, I think you're right that we could just write this as straight JSON without wrapping it in quotes. What are the benefits of doing this?
I tried just putting the all_experiments_json property in Firebug without wrapping it in quotes and I get a 'SyntaxError: invalid label' error. Looks like that is because the keys of the dicts are strings. Probably a way to generate this JSON server-side that makes Javascript happy.
One potential downside of making it just straight JSON is that this is generated by our Python template and if for whatever reason this isn't valid JSON it would throw a javascript exception when the file is loaded.
Right now our backend that generates this JSON does this:
dump = simplejson.dumps(experiments_dict)
dump = dump.replace("\\", "\\\\")
dump = dump.replace("'", "\\'")
The dump is the block of text that gets wrapped by '' in our template.Thoughts on a better way to do this?