
Re: "Object required" errors with jquery-ui
Bringing this thread back to life;
I have a site using infinite scroll to pull in content which has some rounded corners.
PIE and Inf Scroll exist happily together in IE7, but in IE8 I get the same error as OP when infinite scroll loads in new content to the page. For every object that should have the behaviour applied to it, I get a null object reference (exact error varies depending on what debug tool you use, but I have seen it referred to as Object Required and also as " 'null' is null or not an object" ) on line 50, char 86 and the rounded corners don't display.
The error only happens when new content is appended by Infinite Scroll, the first page of content applies PIE with no errors. Bizarrely if you have the IE Tester Debug bar addon installed, it fixes the problem.
Aside from Infinite Scroll, other plugins being used are the standard jQuery library, IE PNG fix behaviour and jQuery Cookies.
Any ideas about this are much appreciated, really don't want to have to retrofit oldschool png round corners.
EDIT:
I swapped in the uncompressed version, error now reports as:
null object reference on line 1812, char 17
code block around it reads:
Code:
updatePos: function() {
if( this.isActive() ) {
var el = this.element,
par = el,
docEl,
elRect, parRect,
s = this.getBox().style, cs,
x = 0, y = 0;
// Get the element's offsets from its nearest positioned ancestor. Uses
// getBoundingClientRect for accuracy and speed.
do {
par = par.offsetParent;
} while( par && par.currentStyle.position === 'static' );
elRect = el.getBoundingClientRect();
if( par ) {
parRect = par.getBoundingClientRect();
cs = par.currentStyle;
x = elRect.left - parRect.left - ( parseFloat(cs.borderLeftWidth) || 0 );
y = elRect.top - parRect.top - ( parseFloat(cs.borderTopWidth) || 0 );
} else {
docEl = el.document.documentElement;
x = elRect.left + docEl.scrollLeft - docEl.clientLeft;
y = elRect.top + docEl.scrollTop - docEl.clientTop;
}
s.left = x;
s.top = y;
s.zIndex = el.currentStyle.position === 'static' ? -1 : el.currentStyle.zIndex;
}
}
EDIT 2:
it looks like under normal circumstances the code block runs through and executes the IF part of the statement. However on infinite scrolling, it instead tries to execute the ELSE block, and then finds that el.document.documentElement returns a null value. Updated the code block to show the whole function, in case that extra context helps.