It appears that the code is functional when there are no spaces in the content
<a onclick=fbShareDialog("{\"name\":\"aaaaaaa\"}">
However, if there is a space present
<a onclick=fbShareDialog("{\"name\":\"bbbbb bbbbb\"}">
An error is thrown: Uncaught SyntaxError: unexpected token illegal
I believe all the content is within quotation marks, so why does it not work?
Thank you in advance