Issues like that are foremost in my mind. It's necessary to do ''something'' with scripts before dropping them in the DOM so we can prevent certain misbehaving browsers from executing them automatically, and it's also necessary to provide continuity with the past decision to execute them "once" as they land, but beyond that the landscape of possibilities is fairly open. The most important thing is having a productive discussion now to agree on and document a policy, hopefully one that will allow us to take further positive steps in the future.
Assuming that we'll still be running scripts through
globalEval, and that we don't want to accidentally do so too often, I think we can meet the spirit of previous versions by assuming that anything already in the document has already been executed (and that there's no reason to execute anything until it actually hits the document). And if we're okay with ''re''-executing
.detached scripts, we can accomplish it without any new
.clone issues or expensive code outside of
domManip. Of course, "once and only once" is also possible if that's what we want.
To ease the transition, we might want to expose a convenience method that makes it easy to scrub a jQuery set... maybe a generalization of the input/script loops in
jQuery.clean. Longer term, a flag controlling script execution is also a possibility.