Simplified check for XMLHttpRequest (saving a few bytes) and fixed load()-test

This commit is contained in:
Jörn Zaefferer 2007-01-17 14:17:09 +00:00
parent b98898d95b
commit 32f688d303
2 changed files with 3 additions and 3 deletions

View file

@ -132,7 +132,7 @@ jQuery.fn.extend({
}); });
// If IE is used, create a wrapper for the XMLHttpRequest object // If IE is used, create a wrapper for the XMLHttpRequest object
if ( jQuery.browser.msie && typeof XMLHttpRequest == "undefined" ) if ( !window.XMLHttpRequest )
XMLHttpRequest = function(){ XMLHttpRequest = function(){
return new ActiveXObject("Microsoft.XMLHTTP"); return new ActiveXObject("Microsoft.XMLHTTP");
}; };

View file

@ -70,8 +70,8 @@ test("load(String, Object, Function) - inject without callback", function() {
test("load(String, Object, Function) - check scripts", function() { test("load(String, Object, Function) - check scripts", function() {
expect(7); expect(7);
stop(); stop();
var testFoo = undefined; window.testFoo = undefined;
foobar = null; window.foobar = null;
var verifyEvaluation = function() { var verifyEvaluation = function() {
ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( foobar == "bar", 'Check if script src was evaluated after load' );
ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM');