Step 1, Look at the result of the code as is.
Step 2. Load up the newest jQuery library
Step 3. Go through the code in order of functions fired and add a console.log() in each one. and reload. The first console.log() that isn't fired, you know that's the function that isn't getting called.
For me, it turned out to be the ajax success function, so I took a look at the $.ajax request and just started commenting out things and, fortunately enough, commenting out the timeout line caused it to work.