Simple script... checks a field value... if not blank, it ".writes" the value to HTML... if it is blank, it uses the data from a different field. If the variable value has an apostrophe in it, the whole thing returns a blank string. It obviously breaks the code. There are many reference to this type of thing on the web, but NONE of the solutions I've tried have worked. Below is a sample, including code to escape the apostrophe with a "\" character. Doesn't work... HELP!
<script>
var X='[@field:Event_Name_Override]';
var Y='[@field:Event_Name]';
X = X.replace(/\'/g, "");
Y = Y.replace(/\'/g, "");
if (X.length>1)
{
document.write(X);
}
else
{
document.write(Y);
}
</script>