Home > Uncategorized > ‘undefined’ is not an object (evaluating ‘d[0][a.expando]’)

‘undefined’ is not an object (evaluating ‘d[0][a.expando]’)

I came across a very unusual error with JQuery Mobile (JQM), where I had a few listviews added to a page dynamically, then wanted to initialize them with the $(“.ulXYZ”).listview(); command, this was throwing a cryptic exception:

‘undefined’ is not an object (evaluating ‘d[0][a.expando]’

Which resulted in the first listview on the page not being initialized

My solution, catch the error, and attempt a refresh a second later:

try
{
// Result list may not be yet initialized
$(“.ulXYZ”).listview();
}
catch(e){
console.log(“failed to refresh listview:” + e)
setTimeout(function(){
$(“.ulXYZ”).listview(“refresh”);
console.log(“Attempting refresh”); },1000);
};

Would love to know what the underlying cause of the problem is, but this fixes it after a second delay.

Advertisements
Categories: Uncategorized
  1. October 22, 2012 at 4:58 pm

    This error may also appear as: Uncaught TypeError: Cannot read property ‘jQuery171009381325915455818’ of undefined

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: