Prototype has lacked the ability to properly execute code in the global space.
The use of eval has its limitations.
- Its scope is assigned from the closure it was called.
- Its not executed synchronously in Safari
- It doesn't handle CDATA comments or legacy <!-- comments correctly
- It angers the eval() trolls, seriously they can be sooo mean!
To avoid this use Prototype.exec(code);
- The code accepts a string or any object with a toString() method.
- It doesn't use eval()
- It doesn't require a browser sniff.
- It works with CDATA comments and legacy <!-- comments
- It takes a broadsword to eval() trolls
- 1 ups the jQuery implimentation by fixing a bug in firefox 2.0.0.2 on Mac