|Reported by:||liviumirea||Owned by:|
In WordPress 3.4, the <script> tags were simply added to the DOM along with the rest of the HTML. Now, it seems the <script> tags are extracted from the rest of the HTML and are executed before the HTML is added to the DOM.
A simple example to reproduce the problem:
This should always pop a message box containing "1" (i.e. the number of elements found with the "bug_test_div" id), but it doesn't in the following situation:
Access the admin panel, add a new post and click on the "Add Media" button. Upload an image and you will get a message box saying "1". Good. Now upload another image and select it. Now you'll get "0" instead of "1". Select the previous image or any other image and you will still get "0" instead of "1".
Note that this works without a problem (i.e. always outputs "1") in the "Admin panel -> Media -> Edit Media" pages.