My understanding is that jQuery evaluates and strips all <script>
tags from a HTML fragment loaded with AJAX, although at the moment I can't find a proof of that in jQuery docs:
"html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
However, here is is in John Resig's own words:
When a script node is inserted into the document it is also executed (by jQuery). To avoid re-executing it later (this happens a lot, as it turns out) the script is simply removed from the document.
Naturally, this causes some issues when you actually want to see the contents of the script element (as you do). However I think the trade-off is better in this case.
The one alternative solution that I can think of is to use the internal .data() API to attach information to the script element, informing it that shouldn't be executed again at a later time. I'm not sure how unexpected that is, though.
so, at least, jQuery used to strip <script>
tags in 2009.
To verify you can use Firebug etc. to confirm that your application indeed returns a HTML blob with the <script>
tag included - if you confirm this then it's totally not related to Pyramid of Mako