Uncaught SyntaxError: JSON.parse: expected property name or '}' at line 1 column 2 of the JSON data
_evtClick http://localhost:8889/static/lab/jlab_core.c1feae0690cd2229a88c.js?v=c1feae0690cd2229a88c:1
handleEvent http://localhost:8889/static/lab/jlab_core.c1feae0690cd2229a88c.js?v=c1feae0690cd2229a88c:1
jlab_core.c1feae0690cd2229a88c.js:1:152248
plus other variations on quotations around the arguments in the -args string. The last one seems to work with JSON.stringify(), but the error is the same for all of them. I am trying some workarounds for my use case (rewriting the offending command so that it does not need arguments), but would be happy to get the arguments working with the CommandLinker.
The arguments that you are passing are not a valid JSON. JSON is a very strict format, it requires double quotes for keys and string values and no trailing commas. The followign ones should work:
Thank you. I was able to get your first example working with careful escaping for my use case. My specific use case is passing a javascript string wrapping what I want in the python display(HTML(<html string>)) call to a code cell. The syntax that worked was:
Your second example assuming \1" is actually \" does not work for me (at least in FireFox). However, counter-intuitively the following does (although I could not come up with an escape sequence allowing me to pass it from a javascript string):