Showing posts with label IE unspecified error. Show all posts
Showing posts with label IE unspecified error. Show all posts

Wednesday, August 11, 2010

HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

When creating dynamically generated pages, you can meet following error in IE browser:

HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

That "KB927917" secret code also comes along with

Line: 0
Character: 0
Source: 0

So now you "know" where to dig to.

So I met one. And it was odd, cuz my JS is runing on Jquery's document.ready event, when everything should be ready:

$(document).ready(function(){
... my js ...
});

But it does not make any sense for IE? No. For FF3, Chrome, etc. does, but not for IE. So what does?

$(document).ready(function(){
setInterval("documentIsReallyReadyNowEvenInIE();",1000);
});
function documentIsReallyReadyNowEvenInIE() {
... my js ...
}

Вот-так-то

Monday, June 21, 2010

JQuery droppable "unspecified error" in IE

I was implementing some Drag'N'Drop algoritms using JQuery .draggable & .droppable plugins, when in IE got "unspecified error". Thanks to Microsoft, they finaly got released so called "Development Tools". Debugging my page using that, gave me exception inside jQuery's code. It was the line saying "d=b.getboundingclientrect()".

It got me a while to understand why that happens, and the answer is:
jQuery's event handles/listerners are not unbinded automatically from the elements you remove from the DOM... they keep firing. So every time you use something like $('...').droppable(...
you should also do $('...').droppable('destroy'), if you remove that $('...') from the DOM. I did.

Conclusion: $('...').droppable('destroy');