Cannot apply jQuery to list view on iPad. AJAX cancels jQuery changes.

Home Forums Calendar Products Events Calendar PRO Cannot apply jQuery to list view on iPad. AJAX cancels jQuery changes.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #86339
    Tony
    Participant

    I am applying some jQuery to elements within the list view in my theme.
    The jQuery works fine on Desktops and Android. However, on iPad the jQuery loads and is applied, but once the AJAX finishes loading, all the jQuery changes disappear.

    Yes, the script is being enqueued correctly – I have tried enqueueing in both the header and the footer. There are no errors in the JS console.

    How can this be fixed?

    #86925
    Brook
    Participant

    Howdy trumpeter,

    I think your script is probably attaching itself onload. This is an issue when we run an ajax call, because onload will have already fired and your script will not attach itself to the new content. To remedy try reattaching your functions once an ajax call is made. You can do that by replacing the console.log line in the following with your relevant functions:

    jQuery(tribe_ev.events).on(“tribe_ev_ajaxSuccess”, function () {
    console.log(“tribe_ev_ajaxSuccess”);
    });

    Does that help fix it? Thanks!

    – Brook

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Cannot apply jQuery to list view on iPad. AJAX cancels jQuery changes.’ is closed to new replies.