Skip to content
Advertisement

When my variable has an apostophe in it, it cannot be used for onshow

I’m using a conditional in templating engine tinybutstrong to show a <div> when a variable is not blank.

JavaScript

It works well except for when the $notice variable has an apostrophe ' in it. Otherwise the onshow conditonal doesn’t run.

How do I fix this?

Advertisement

Answer

The values may have quotes, you have to use delimiters and escaping :

JavaScript

The manual has been updated in order to have this clearer.

But is you case, using a magnet seems smarter:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement