https://bugzilla.wikimedia.org/show_bug.cgi?id=47872

--- Comment #4 from Liangent <[email protected]> ---
(In reply to comment #0)
> @Liangent: Can you given an example where it matters for a user script
> whether
> the document becomes ready before or after they are loaded? The user scripts
> are loaded from the bottom of the <body> before </body>. Practically the
> document is already ready at this point, just $(document).ready() hasn't
> fired
> yet. Any user script code that isn't wrapped in $(document).ready() will
> still
> execute at exactly the same time. Any user script code that *is* wrapped in
> $(document).ready() will now execute immediately after loading instead of...
> immediately after loading. Exactly the same, not?

Let me give a (almost) real world example (difference explained below):

We have some gadgets (technically some gadgets, but socially one gadget; not
using [ResourceLoader]). The first is the gadget itself, which registers some
global states as data/options, then $(document).ready() its execution code. All
gadgets below are modifiers for the gadget which change those global states so
when the main body of the gadget is executed, the modified global states are
visible to it. But now...

Difference from real world: addOnloadHook() is used there instead of
$(document).ready() so it finally escaped :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to