actually re-reading your question, it sounds like ...
# general
d
actually re-reading your question, it sounds like the groovy side is correct. Can you wrap your JS string in double quotes so it allows the single quote? e.g. var test = " ' "; is fine... var test = ' ' '; clearly would break things....