When Ajax was first introduced by Microsoft several years ago, even though it was known by another name then, nobody knew the impact that it would have on modern day web development.
Now the language is taken seriously by everybody.
It has its own frameworks and it now allows a web page to feel like a true application.
There is no more having to do a refresh when you want the application to perform an action.
Before, if you ran across something suspicious, it would probably slow your browser down to a crawl and you would close it before it got the chance to execute.
Now, with the faster engines, it will speed right through and there may be no chance for you to stop it before it finishes.
Modern compilers and JIT (Just in time) compilers can evaluate buffer overflows and other items that might cause an exploit on a compiled program.
As of right now there are no automatic ways to tell of a vulnerability while the script is already running.
The best way that we have to stop the problem is to use technology such as no-script and flashblock.