Gerade auf Twitter gelesen:
buildFragment() uses jQuery.clean() to extract the JS code of <script> elements. If it uses the cached DOM Fragment, clean() isn’t called. In this case, the ‘scripts’ array remains empty so that evalScript() isn’t called any longer.
Test case:
<p><a href=”" id=”start”>call html()</a></p>
<div id=”output”></div>
<script> $(function ($) {
$(‘#start’).click(function (e) {
$(‘#output’).html(“<script> alert(‘should be executed’); <\/script>”); e.preventDefault();
});
}); </script>
This works as expected for the first and second click, but the third time the cache kicks in and the embedded script isn’t executed.
This used to work in jQuery 1.3. I’ve encountered this bug in an Ajax environment using .load(). If the Ajax response is the same three times in a row, the embedded scripts weren’t executed.



März 7th, 2010 - 16:50
Another interesting article from your blog
When will it stop….hopefully never
August 8th, 2011 - 21:16
hello there and thank you for your information – I’ve certainly picked up anything new from right here. I did however expertise a few technical issues using this site, since I experienced to reload the website lots of times previous to I could get it to load correctly. I had been wondering if your web host is OK? Not that I’m complaining, but sluggish loading instances times will very frequently affect your placement in google and could damage your quality score if advertising and marketing with Adwords. Well I’m adding this RSS to my email and can look out for much more of your respective interesting content. Ensure that you update this again soon..