As long as we document this well, this should not be a problem for users .  Right now, this is mostly an issue for developers.

If we really wanted to be compulsive, we could capture the HTML output and check whether there are EM-related <span> elements within <script> blocks (and provide an appropriate alert), but that is probably overkill.


On Mon, Sep 19, 2011 at 10:13 AM, Tony Partner <> wrote:

Hi Tom,


Will this be a problem with uninformed users?


As far as I know “if (true){//do something}” is valid script (if not well-formed) so users will invariably try to use something similar.




From: Thomas White, MD, MS, MA []
Sent: September-19-11 9:47 AM
Subject: [limesurvey-developers] Important note about ExpressionManager and JavaScript




Please note the Expression Manager (EM) tries to parse anything surrounded by curly braces UNLESS there is whitespace (e.g. a newline, tab, or space) after the opening curly brace.  So, if you write JavaScript, make sure to add a space or newline after a curly brace (instead of putting it all on one line). Otherwise, your generated HTML will have embedded <span> sections trying to highlight syntax errors.  For example, if you if you had



if (true){bogus}



The output would be this:



if (true)<span title='Undefined variable' style='border-style: solid; border-width: 2px; border-color: red;'><span title='Undefined variable' style='color: #228b22; font-weight: bold'>bogus</span></span>



But if you added the space after the curly brace like this:



if (true){ bogus }



EM would not try to parse it.



Email scanned by PC Tools - No viruses or spyware found.
(Email Guard:, Virus/Spyware Database: 6.18280)

BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry&reg; mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry&reg; DevCon today!
limesurvey-developers mailing list