bug 7706 quadruple execution

demonstrates that code in ${} gets run 4x instead of 1x.

by corydodt

HTML

<script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
A demonstration of <a href="http://bugs.jquery.com/ticket/7706#">bug 7706</a>: code in ${} is executed quadruply.
<hr>    
<script type="text/html" id="thingies">
      ${(x++)?"":""}
      <p>x should be 1: <br> x=${x}</p>
</script>


<span id="cursor" />

JavaScript

$(function() {
  window.x = 0;
  $('#thingies').tmpl({}).insertBefore('#cursor');
});