I felt like I had to share this story! I was sitting at my desk, stumped, because I was trying to create a logout action for an app using the Facebook API and it seemed like my jQuery selectors were ignoring me. I double checked everything, did some back research on .live() and .on(). Did some more research on delegated events (since I was binding a click event to an element generated after the DOM loads). Nothing. I could NOT get it to work! I decided it might be because I was using an ID selector instead of a Class (you never know the weird things that can cause your program to break) and I noticed that I had the following code: <a id=&quot;&logout&quot; href=&quot;#!/logout&quot;>Logout</a>
Anybody catch my mistake? id="#logout" should NOT have a # sign in it! DOH! Still, it wasn't a total waste. I learned that .live() has been deprecated in favor of using .on() delegated events. You can read more about that  here.

Similar Posts