Skip to main content
1 of 2
MikeD
  • 171
  • 1
  • 2

The page seems to be breaking in Chrome for the stack overflow nominations with the following message "Uncaught TypeError: Cannot read property 'length' of undefined". It stops working after the step "Loading User Profile on main site".

Looking at the code it would appear that line 607 is causing problems:

userId = +post.find('.user-details a').attr('href').split('/')[2];

The reason is that the value of the href attribute as returned by jQuery is qualified with the host name despite that not appearing in the source. From my console window:

post.find('.user-details a').attr('href').split('/')
["http:", "", "stackoverflow.com", "users", "92837", "sathya?tab=activity&sort=reviews"]

The result of this is a list of user ids containing "NaN".

MikeD
  • 171
  • 1
  • 2