Trouble with links inside affected div
I'm doing an ajax website. When a link outside of the affected div is clicked on, then the ajax works, but if I click on a link inside the affected div, it doesn't. Please help. My js code's below:
With "affected div" you mean the div with id "divname" whose content changes by using the Ajax .load() method?
This is because .click() can only bind to elements that exists at the moment the method is called. Everything that is added afterwards (like by using the .load() method) will not be covered by this .click() handler.
Solution: With jQuery pre 1.7 you should use .live() and starting with jQuery 1.7 you should use .on()
|All times are GMT +1. The time now is 05:17 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.