This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

ajax no results click event

Home Forums Product Support Forums Ajax Search Pro for WordPress Support ajax no results click event

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19641
    charterbuzzcharterbuzz
    Participant

    Hello, I am trying to do a custom redirect if the ajax search results pro returns no results. I see there is a class “asp_nores” and I tried doing a jquery clickEvent but nothing seems to fire. What I tried was $(‘.asp_nores’).click(function(){ console.log(‘clicked’); }); I am not sure if this is because it’s outside of the DOM. Do you have a solution for me?

    #19647
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    The issue is, that the element is not present in the dom, but dynamically generated via the ajax request. There is a solution, using an event handler on a higher level static node, and then targeting the child like this:

    This will do the trick.

    #19649
    charterbuzzcharterbuzz
    Participant

    Thank you so much! I love your plugin by the way.

    #19650
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.