Unspecified error When Using UpdatePanel #149

Open
kishorekumarbv opened this Issue Jul 6, 2011 · 10 comments

Comments

Projects
None yet
6 participants

I am using Ajax Update panel in my Project.

When the partial Postback happens i.e. Updatepanel updates means i am facing the issue at below line

ub:function(){var a=this.e.getBoundingClientRect();

and the error is "Unspecified error."

can any one resolve this plz.

I have been struggling with this as well.. its showing up for me on line 970 of pie_uncompressed.htc in beta 4

var rect = this.targetElement.getBoundingClientRect();

It appears this is the same issue that the jQuery team had a little while ago.

http://bugs.jquery.com/ticket/4996#comment:11

If this fix could make it in to the beta 5 that is soon to be released, that would be awesome!
FWIW - I have seen this error on Ajax enabled pages in ASP.NET only when using IE6/7.

Owner

lojjic commented Jul 24, 2011

@stephenanders Thanks for the jquery reference, that's very helpful.

Are either of you able to provide a standalone testcase document that triggers the error, so I can test the fix against it?

@lojjic
I tried for a while yesterday to put together a stand alone page that would recreate this problem, but so far have been unable to do so..
I did try to modify the PIE_uncompressed.htc file with the fix listed to see if that would get around the error - and it did, but then I started getting something different:

Error: 'null' is null or not an object
Line: 1058
URL: PIE_uncompressed.htc

1049:    getCss: cacheWhenLocked( function() {
1050:    var el = this.targetElement,
1051:        ctor = this.constructor,
1052:        s = el.style,
1053:        cs = el.currentStyle,
1054:        cssProp = this.cssProperty,
1055:        styleProp = this.styleProperty,
1056:        prefixedCssProp = ctor._prefixedCssProp || ( ctor._prefixedCssProp = PIE.CSS_PREFIX + cssProp ),
1057:        prefixedStyleProp = ctor._prefixedStyleProp || ( ctor._prefixedStyleProp = PIE.STYLE_PREFIX + styleProp.charAt(0).toUpperCase() + styleProp.substring(1) );
1058:    return s[ prefixedStyleProp ] || cs.getAttribute( prefixedCssProp ) || s[ styleProp ] || cs.getAttribute( cssProp );  
1059:    } ),

The problem there is that the currentStyle object is null when it is trying to get style information.. I dont know when or why currentStyle would be Null in Internet Explorer (unless its not added to the DOM, but this object is declared on the page and never removed from the DOM..). So it sounds like there may be some other errors in my javascript that might be affecting this.

Its hard to duplicate this b/c this page uses a master page and an update panel, ASP.NET page methods, ASP.NET history state, and there are callbacks implemented. I have implemented most of this functionality in my test page trying to recreate the problem, but its still not producing the error.

If you have a modified .htc you want me to test with, I'd be happy to do it. otherwise I'm going to keep trying to figure this out. Its only happening on one page with one specific partial page update.
urghh.

I finally got a little more time to look into this issue.
I think there must be something I'm doing in the page that is either breaking an assumption by PIE, or is causing PIE to try to operate on an element that is not part of the DOM..

I mentioned that I got past the getBoundingClientRect() error by using the offset properties mentioned in the jquery link. After I did that, I started getting 2 other errors: 1) the one listed above where el.currentStyle was null - which gave me a 'null' is null or not an object error, and 2) invalid argument error in the removeLayer() function definition at box.removeChild(layer).
All of these errors seem to relate to DOM manipulation on items that either are not part of the DOM or are somehow not visible/available to PIE. I dont know what I've done that is causing this, b/c at the point where the errors are occurring, I'm not removing any elements from the DOM.
I have updated the uncompressed version of the .htc to avoid these 3 errors, and have not seen any negative impact on the behavior/performance of PIE. If you would like the file with my changes to look at/test with, just let me know how to get it to you.
I haven't made any other efforts yet into producing a test case b/c I thought I already had everything in place when I tried to do that last month, but the error did not show up. If you need to see the error in action, I can probably get you set up with a trial account on my company's site, and guide you to it.

One more thing is that I was wrong about it being specific to IE6/7 b/c I am also getting it on IE8. Don't know why I didn't notice that before..

msssk commented Sep 9, 2011

(Using PIE_uncompressed.js beta 5 and IE8)

I have been getting a lot of null errors with currentStyle. It may not be ideal, but I worked around it for now by adding a mock:

PIE.currentStyleMock = {
    getAttribute: function() {
        return '';
    },
    borderWidth: '',
    borderStyle: '',
    borderColor: ''
};

I then changed all references to it:

cs = el.currentStyle || PIE.currentStyleMock

The 'invalid argument' error in removeLayer() can be ignored by wrapping it with try-catch (so far, without negative effects):

removeLayer: function( index ) {
    var layer = this.getLayer( index ),
        box = this._box;
    if( layer && box ) {
        try {
            box.removeChild( layer );
        }
        catch( err ) {
        }
        this._layers[index] = null;
    }
}

I was also getting errors with getBoundingClientRect(), so in getLiveBounds() I changed it to:

try {
    rect = this.targetElement.getBoundingClientRect();
}
catch( err ) {
    rect = {left: 0, top: 0, right: 0, bottom: 0};
}

Not sure how to link a pull request to an issue in Github, but: see my attempt to address in 91e9117

currentStyle is Async in IE, and/or may be null if an element is created using createElement. Either way, PIE needs to make sure currentStyle is present before accessing its methods.

(see http://stackoverflow.com/questions/3722736/weird-ie-behavior-currentstyle-returns-null)

Owner

lojjic commented Feb 13, 2013

Similar report in the forums: http://css3pie.com/forum/viewtopic.php?f=6&t=1975

I really need a test case for this. Can anybody help me out with that?

@stephenanders -- do you mind sharing your updated PIE.htc with me? I am experiencing all of the errors you mentioned above.

@LandonLunsford - I created a fork of this repo and committed the fixes that I have been using. I haven't worked on this in a while - thankfully b/c I haven't had to! Implementing these fixes has made the errors go away for me, but I have not been able to create a standalone test case for full-cycle testing and verification of the fix.

I added the build output to my fork so that you can download the individual files you want - they are in the /build folder. See my fork here: https://github.com/stephenanders/PIE

I was going to do a pull request, but I feel like this is more of a hack/workaround than an actual fix. Like I said, this seems to work for me, but may not hold up in all cases. Hope it helps!

Thank you so much! I'll let you know how it works out! These issues with
PIE/IE have been tormenting me for so long.

On Wed, Dec 4, 2013 at 11:31 AM, stephenanders notifications@github.comwrote:

@LandonLunsford https://github.com/LandonLunsford - I created a fork of
this repo and committed the fixes that I have been using. I haven't worked
on this in a while - thankfully b/c I haven't had to! Implementing these
fixes has made the errors go away for me, but I have not been able to
create a standalone test case for full-cycle testing and verification of
the fix.

I added the build output to my fork so that you can download the
individual files you want - they are in the /build folder. See my fork
here: https://github.com/stephenanders/PIE

I was going to do a pull request, but I feel like this is more of a
hack/workaround than an actual fix. Like I said, this seems to work for me,
but may not hold up in all cases. Hope it helps!


Reply to this email directly or view it on GitHubhttps://github.com/lojjic/PIE/issues/149#issuecomment-29836908
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment