On "use strict", my understanding was that it applies per script:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Strict mode applies to entire scripts or to individual functions.
Am I misunderstanding?
On "use strict", my understanding was that it applies per script:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Strict mode applies to entire scripts or to individual functions.
Am I misunderstanding?
Since the rest of your script is already enclosed inside a single function, simply move the "use strict" a few lines down so it is the first line in that function. Then it will only apply to your own code.
If it has an entry point, it's not a library, it's an application. If said application does basically nothing on its own and you're supposed to extend it, it's a framework.
http://en.wikipedia.org/wiki/Software_framework
Pay close attention to the 4 bullet points in the first section.
> On "use strict", my understanding was that it applies per script
Yes. However, when you merge scripts, there is only one script at the end.
The site you linked to also mentions this problem.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
"This syntax has a trap that has already bitten a major site: it isn't possible to blindly concatenate non-conflicting scripts. [...] It is thus recommended that you enable strict mode on a function-by-function basis [...]"
Good point on the concatenation issue, I'll fix it for the next release.
It does.
There is an IIFE which is run when the script is loaded. Right before the object is returned to the global "Intercooler" variable, a callback is registered via a jQuery.ready() shorthand.
Practically speaking, this callback is the entry point (theoretically, it's the IIFE itself).
If it wouldn't have an entry point, adding attributes to elements would do nothing.
http://en.wikipedia.org/wiki/Entry_point
"an entry point is where control enters a program or piece of code"