Did you actually look at the value of div? I don't see how it could be valid. You'd end up with something like this:
Code:
onclick='showImage('some text')'
You can't have nested single quotes like that. That's probably the syntax error that's being referred to.