Thanks kh99 -
Adding that script yields this in View Source:
Code:
<script type="text/javascript">
var criteriaDisplay = "";
</script>
Which is the same problem in the main Javascript, it's just not seeing the variable. There should be a number there between the quotes that matches the number that is shown on the page where I have <p>{vb:raw criteriaDisplay}</p>. It calls the variable fine outside of Javascript.
Regarding the quote, yes it's the same page/template.