J'ai une application Web ASP.NET qui utilise ASP.NET AJAX. L'application me donne suite à une erreur javascript aléatoireErreur 'longueur' est null ou un objet
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; CIBA; .NET4.0C; .NET4.0E)
Timestamp: Fri, 2 Jul 2010 17:19:22 UTC
Message: 'length' is null or not an object
Line: 5
Char: 18997
Code: 0
URI: http://172.16.199.109/TWQAUDTUK_App/ScriptResource.axd?d=BssYA8UXb_xixM2kbWCVNiQB3yadiDxpyviVKlvm-OzfLO5PAqndPHn02Na1YNGeyuN9FBDbUO716zVqct-04yJjJTi77-kEQQ_jKSRCUY81&t=5dc69638
L'endroit que je suis dans l'erreur est MicrosoftAjax.js
Array.indexOf = function Array$indexOf(array, item, start) {
/// <param name="array" type="Array" elementMayBeNull="true"></param>
/// <param name="item" optional="true" mayBeNull="true"></param>
/// <param name="start" optional="true" mayBeNull="true"></param>
/// <returns type="Number"></returns>
var e = Function._validateParams(arguments, [
{name: "array", type: Array, elementMayBeNull: true},
{name: "item", mayBeNull: true, optional: true},
{name: "start", mayBeNull: true, optional: true}
]);
if (e) throw e;
if (typeof(item) === "undefined") return -1;
var length = array.length;
if (length !== 0) {
start = start - 0;
if (isNaN(start)) {
start = 0;
}
else {
if (isFinite(start)) {
start = start - (start % 1);
}
if (start < 0) {
start = Math.max(0, length + start);
}
}
for (var i = start; i < length; i++) {
if ((typeof(array[i]) !== "undefined") && (array[i] === item)) {
return i;
}
}
}
return -1;
}
Comment puis-je résoudre ce problème?
Vous pouvez, et devriez même, modifier votre question pour fournir cette information supplémentaire plutôt que de l'afficher comme réponse. – ChrisF
Désolé, je ne suis pas très familier avec Stack Overflow. Dans un autre groupe de discussion, je poste simplement quelque chose juste après la publication d'autres personnes pour fournir plus d'informations, afin qu'ils sachent que c'est une nouvelle information. Si je modifie ma question initiale, comment leur faire savoir que c'est une information supplémentaire? Merci. – hehongyu2000