3 ms·
> Well, it's a library, not a framework: you can use it for as much or as little of your app as you like with as little as a single attribute declaration doing
by ahoge 12y ago
> Well, it's a library, not a framework: you can use it for as much or as little of your app as you like with as little as a single attribute declaration doing something useful for you.
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 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/Reference/Strict_mode#Strict_mode_for_scripts 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 [...]"
- carsongross 12y agoAh, OK. Well, good news: intercooler doesn't have an entry point. Good point on the concatenation issue, I'll fix it for the next release.
- ahoge 12y ago> intercooler doesn't have an entry point. 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 http://en.wikipedia.org/wiki/Entry_point "an entry point is where control enters a program or piece of code"