Jquery function call in jquery loaded data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    Jquery function call in jquery loaded data

    I have data being loaded on a page using the jquery .load() function which calls a php script and is working grand. I have pagination added to the data loaded onto the page but no jquery functions work when I click on the pagination in the data that has been loaded.

    Does this mean that jquery .click() function wont work on data if that data has been loaded by another jquery function and if so is there a way around this?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    the click() method requires that the appropriate object already exists when you call it. if you load matching elements later on, the assignment is long past.

    afaik, there is a jQuery method (whose name I don’t remember, but you should find it in the documentation) that adds event handlers also to elements, even if they are created later.

    Comment

    Working...