Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Jquery function call in jquery loaded data

  • 21-10-2012 5:56pm
    #1
    Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭


    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?


Comments

  • Registered Users, Registered Users 2 Posts: 6,465 ✭✭✭MOH


    .click won't work for dynamically added elements.

    You'll need to use .delegate or .live

    Have a look at this

    [edit] Actually just re-read that properly myself, .live is deprecated, probably best using .on:
    $(document).on("click", "element", function() {whatever you want to do});


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    Nice one MOH, works perfectly.


Advertisement