Board Thread:Support Requests - Getting Technical/@comment-3448772-20121221215858/@comment-5209426-20121224051517

Actually, jQuery overrides itself in code order. The second copy will replace the first. There is not a major problem with this but there are subtle ones like  extensions getting lost, and memory usage inflation due to both copies of jQuery existing in memory even if only the latest loaded one is visible (event handlers keep the invisible copy from being GCed, the second copy of jQuery will also remember the first one internally).

The scripts loading in the footer is a performance optimisation due to the way browsers process script tags. The  and   attributes sort of fix it, but they're buggy. Loading conditionally via Common.js provides the normal environment you expect and is a lot easier than trying to wallpaper over the problems unless you really, really need the code to run immediately when the browser reaches that point on the page. That sort of situation is rare, since most JS uses  which fires when the page is entirely parsed (footer) anyway.

As I said, the simplest thing to do is put: in Common.js. Then put: in your verbatim page. [Although I would bind the event from JS instead of hardcoding it directly into the HTML]

You really should not write your own  tag JavaScript code unless you are very sure you know what you are doing and why you need to do it that way. Verbatim script tags act as a roadblock that stops the browser dead in its tracks whilst the JS runs and will only resume processing the page after the JS completes.

A more general solution to this sort of problem is to put this in Common.js: Then create verbatim pages that have: [Caveat: Verbatim tags HTML encode the content, so symbols like ampersand get changed to ' ' which breaks things if you have those sorts of characters in your page name.]