If you use both prototype.js and another script which add fonction to the object prototype definition, you get an exception with FireFox.
[Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE)
[nsIXMLHttpRequest.setRequestHeader]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame ::
http://www.mydomain.com/Javascripts/prototype.js :: anonymous :: line 1104" data: no]
for exemple if you have a script that contain :
function (){
var cryptfunction={
object: function(obj){
//code of the function
.......
}
}
Object.prototype.MyCryptFunction = function () {
return cryptfunction.object(this);
}
}
Then Ajax.Request() function will handle an exception because of trying to add MyCryptFunction to the headers of the XMLHTTPRequest object.
To solve the problem :
in prototype.js v 1.5.1
just replace
1103 for (var name in headers)
1104 this.transport.setRequestHeader(name, headers[name]);
by
1103 for (var name in headers){
1104 if (typeof(headers[name])=="string")
1105 this.transport.setRequestHeader(name, headers[name]);
1106 }