Why is my COMET control throwing a javascript error when closing IE8?

I wrote a COMET / Reverse Ajax control in ASP.NET. The javascript part uses jQuery (1.3.2). It seems to work fine, except for closing the browser in IE (8). In this case, it issues "Microsoft JScript Runtime Error: Object does not support this property or method." It's only when IE is closed that I get the error. Firefox and Chrome don't throw errors.

The control is a descendant of System.Web.UI.WebControls.Table.

Violation line:

var currentCell = $("#" + gridName + " tr:nth-child(" + (rowIndex + 1) + ") td:nth-child(" + (cellIndex - rowIndex * columnCount + 1) + ")");

      

"gridName" is the control identifier that is passed to the function as a parameter.

The function containing this string is called in response to a successful POJ Ajax request.

The control works as expected while the page is open. I guess the problem is that something gets deleted when the browser is closed, so the outstanding Ajax request fails when it returns. However, this is just an assumption - I am not familiar with jQuery. I tried setting a flag on the window.unload event to prevent the calling code from being called after the unload event, but that didn't fix the problem.

I am not using Javascript libraries other than jQuery. Javascript includes WebResource.

The problem doesn't occur when I go to a new page - only when the browser is closed.

+2


source to share





All Articles