search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

SCRIPT87: Invalid argument. daypilot-all.min.js, line 24 character 14012

Asked by mashet
10 years ago.

Hello,
I'm getting following error in daypilot:

for(var i=0;i<this.shadow.list.length;i++){$N.removeChild(this.shadow.list[i]);}

removeChild throws exception

My code:

function close(result) {
if (parent && parent.DayPilot && parent.DayPilot.ModalStatic) {
parent.DayPilot.ModalStatic.close(result); //this line generates error
}
}

$("#f").submit(function () {
var f = $("#f");
$.post(f.action, f.serialize(), function (result) {
if (result == "\"Success\"")
close(eval(result));
});
return false;
});

$('#cancel').click(function () {
close();
});

No matter if I click cancel button or post result is Success. Exception is throwing random. After that I can't interact with daypilot control, because it throws error every time.

Comment posted by mashet
10 years ago.

I'm using IE9,
Regards

Answer posted by mashet
10 years ago.

I fixed this by try catching, it's not elegant but works:
for(var i=0;i<this.shadow.list.length;i++)
{
try {
$N.removeChild(this.shadow.list[i]);
} catch (err) {
}
}

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.