D
dennis.sprengers
To avoid future collisions in the global namespace, I'm transferring
all javascript functions my CMS uses to a global object called
"Fluffy". I'm experiencing a problem. FF Firebug tells me Fluffy.AJAX
is not a constructor. I don't understand why not. Could somebody help
me getting this code to work?
---------------------------------------------------------------------
var Fluffy = {};
Fluffy.Bootstrap = {version : '0.1 beta', release : 'jan 1st, 2008'}
Fluffy.Module = function(properties) {
var module = function() {return this.init.apply(this, arguments);};
Fluffy.extend(module, this);
module.prototype = properties;
return module;
}
Fluffy.extend = function() {
var args = arguments;
if (!args[1]) args = [this, args[0]];
for (var property in args[1]) args[0][property] = args[1][property];
return args[0];
}
Fluffy.AJAX = new Fluffy.Module ({
init : function() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
});
var ajax = new Fluffy.AJAX(); // Fluffy.AJAX is not a constructor
all javascript functions my CMS uses to a global object called
"Fluffy". I'm experiencing a problem. FF Firebug tells me Fluffy.AJAX
is not a constructor. I don't understand why not. Could somebody help
me getting this code to work?
---------------------------------------------------------------------
var Fluffy = {};
Fluffy.Bootstrap = {version : '0.1 beta', release : 'jan 1st, 2008'}
Fluffy.Module = function(properties) {
var module = function() {return this.init.apply(this, arguments);};
Fluffy.extend(module, this);
module.prototype = properties;
return module;
}
Fluffy.extend = function() {
var args = arguments;
if (!args[1]) args = [this, args[0]];
for (var property in args[1]) args[0][property] = args[1][property];
return args[0];
}
Fluffy.AJAX = new Fluffy.Module ({
init : function() {
if (window.XMLHttpRequest) {
return new XMLHttpRequest();
}
else {
return new ActiveXObject("Microsoft.XMLHTTP");
}
}
});
var ajax = new Fluffy.AJAX(); // Fluffy.AJAX is not a constructor