You need to escape the characters.

'Jim says it's ok' is obviously going to break.

In JavaScript I believe \ is the escape character so:
'Jim says it\'s ok' would work fine.

Does that cover it?

DJ