global scope evaluation and DOM investigation
After precedent post I prefer to write another one about global scope evaluation and kentaromiura question: does your evalScript proposal cause DOM side effects? Before I post my test code that shows how a medium or big page, about 5000 divs or paragraphs, is not affected by my proposal (about 0.09 delay over 1000 evalScript interactions) I would talk about global scope evaluation. What does it mean: global scope evaluation? Every time we use a function to evaluate a string, temporary scope is injected into code evaluation. While some library (in this case I talk about jQuery ) uses stranges (imho) partial (wrong) solutions to remove nested scope from evaluation, I can tell You that everything You need to use a clear scope is to call another function, where this reference is just super object (window if executed inside a browser). This is an elementary example: function clearScopeEvaluation(data){ return eval(data); }; // just call them everywhere ... (function(a){ clearScopeEvalu...