ajax no results click event

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

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19641
    charterbuzz
    charterbuzz
    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?

    Attachments:
    You must be logged in to view attached files.
    #19647
    Ernest Marcinko
    Ernest 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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #19649
    charterbuzz
    charterbuzz
    Participant

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

    #19650
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.