Ticket #2282 (closed bug: worksforme)
script tags not evaluated in $.ajax
|Reported by:||emclain||Owned by:|
|Keywords:||ajax, scripts, eval||Cc:|
The documentation for $.ajax states that script tags are evaluated when doing an $.ajax call: http://docs.jquery.com/Ajax/jQuery.ajax#options
"html": Returns HTML as plain text; included script tags are evaluated.
However, that doesn't seem to be the case. My test case is below. If the scripts were being executed, I would expect two alerts: the first "ajax" and the second "done". Instead I just see "done", both in FF2 and IE7.
I've also tried setting variables in the ajax page and reading them in the main page (in case there was some anomaly with alert()), but that didn't work either.
<!-- ajax page --> <script> alert('ajax'); </script>