Side navigation
#1654 closed bug (duplicate)
Opened September 17, 2007 09:33PM UTC
Closed October 17, 2007 10:10PM UTC
AJAX inserted Javascript (<script>) code not executing when document ready.
Reported by: | zackgilbert | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.1 |
Component: | ajax | Version: | 1.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When a snippet of code is insert into a page with AJAX, any <script> located within the snippet is executed as the document is getting parsed and not after the snippet is actually inserted.
Sample code (that doesn't work) - Located in the file being loaded with AJAX:
$(document).ready(...);
A fix (thanks John):
$(document).ready(function(){ setTimeout(..., 10); });
I think that this is the same bug as the one described here:
http://dev.jquery.com/ticket/1698 (with patch available)