Opened 6 years ago

Closed 6 years ago

#9387 closed bug (notabug)

Error: 'data(...)' is null or not an object

Reported by: tward Owned by: tward
Priority: minor Milestone: none
Component: ui.dialog Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

jQuery 1.10.3 Dialog issue with IE8

Line: 10 Error: 'data(...)' is null or not an object

Example: http://jsfiddle.net/tward/qV3hY/

Clicking the "testing" link shows a dialog. Click anywhere in the overlay and you get the above message.

Others report it in Firefox as well, but I can't get it consistently there.

Change History (6)

comment:1 Changed 6 years ago by tj.vantoll

Owner: set to tward
Status: newpending

Hi tward,

Thanks for taking the time to contribute to the jQuery UI project. I'm seeing the error you're describing, but there's a lot going on in your test case so it's ascertain exactly what's happening. Would you mind reducing your test case to the absolute minimum amount of code needed that still shows the error?

The less JavaScript the better. Thanks!

comment:2 in reply to:  1 Changed 6 years ago by tward

Status: pendingnew

Replying to tj.vantoll:

Hi tward,

Thanks for taking the time to contribute to the jQuery UI project. I'm seeing the error you're describing, but there's a lot going on in your test case so it's ascertain exactly what's happening. Would you mind reducing your test case to the absolute minimum amount of code needed that still shows the error?

The less JavaScript the better. Thanks!

I thought I had! I removed some more stuff that was not needed for the test case... Let me know if it is not enough.

Thanks.

comment:3 Changed 6 years ago by tj.vantoll

Status: newpending

Interestingly I no longer get an error in http://jsfiddle.net/tward/qV3hY/3/ but I do with http://jsfiddle.net/tward/qV3hY/2/. Are you seeing the same?

comment:4 in reply to:  3 ; Changed 6 years ago by tward

Status: pendingnew

Replying to tj.vantoll:

Interestingly I no longer get an error in http://jsfiddle.net/tward/qV3hY/3/ but I do with http://jsfiddle.net/tward/qV3hY/2/. Are you seeing the same?

That is odd, but yes I am seeing the same thing. After more fiddling with it, it appears to be the following code that causes the problem:

   try
      {
       var LocatorDiv = document.getElementById('LocatorDiv');
       LocatorDiv.className="LocatorDiv";
      }
 catch(err)
      {
      }    

The only thing that changed when this started happening was when I upgraded the UI to 1.10.3.

comment:5 in reply to:  4 Changed 6 years ago by tward

Replying to tward:

Replying to tj.vantoll:

Interestingly I no longer get an error in http://jsfiddle.net/tward/qV3hY/3/ but I do with http://jsfiddle.net/tward/qV3hY/2/. Are you seeing the same?

That is odd, but yes I am seeing the same thing. After more fiddling with it, it appears to be the following code that causes the problem:

   try
      {
       var LocatorDiv = document.getElementById('LocatorDiv');
       LocatorDiv.className="LocatorDiv";
      }
 catch(err)
      {
      }    

The only thing that changed when this started happening was when I upgraded the UI to 1.10.3.

I guess the LocatorDiv.className="LocatorDiv" is effectively removing "ui-dialog-content ui-widget-content" from the classNames, not sure why 1.10.3 has a problem with it, but I fixed it by not doing the above.

Guess it is not really a bug in jQuery UI, but a problem with what I was doing.

comment:6 Changed 6 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Ok. Internally the widget looks for those classes for determine whether clicks came from within the dialog.

Note: See TracTickets for help on using tickets.