What's going wrong
Microsoft's Coded UI browser injects javascript to shim the XMLHttpRequest object for tracking. Any ajax calls in the page will use this shim instead of the real XMLHttpRequest. The shim assumes that your completion callback is attached to the XMLHttpRequest's onreadystatechange property, but jQuery 2.0 uses the new onload and onerror events, so the callback is never called by the shim.
Workaround
The work-around is to add the following to the App.config file for your test project:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="WebWaitForReadyLevel" value="3"/>
</appSettings>
</configuration>
Setting WebWaitForReadyLevel to 3 stops the Coded UI WebBrowser from injecting the javascript to track ajax calls and timers. jQuery will get a real XMLHttpRequest, and your ajax callbacks will work again.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…