Support » Plugin: Login With Ajax » AJAX Function works only once

  • grafistape


    Hi There im using this function to load a post preview on the same page, everything goes well so far im able to send the post id and get back, the problem is that i have Ajax filters on the same ponting to the same listing grid, and this function works only when the page is load for the first time, if apply some filter this function doesn’t work
    Im using a Listing Grid built with JetEngine and JetSmartFilters

    Any suggestion?

        jQuery(".jet-listing-dynamic-link__link").on("click", function(e){
    		var url = jQuery(this).attr('href');
    		var id = url.match(/id=(\d+)/)[1];
                    type : "post",
                    url : '',
                    data : {
                        action: "notify_button_click", 
                        message : "Button has been clicked!",
    	            id_post: id
                    error: function(response){
                    success: function(response) {
Viewing 1 replies (of 1 total)
  • timrv



    The code you mentioned doesn’t seems like it belongs to our plugin. I think it would be better to ask the Developers of Listing Grid/JetEngine and JetSmartFilters for this one.

    The code you mentioned seems to be correct to me, However I can’t say certainly why it’s only firing once.

    Since you have added a console.log, You should be able to see on until which part is only firing once. in case it’s only firing only until the “console.log(id);” then the issue is somewhere with the on click. I would suggest changing it to something like:

    jQuery('.SOME-PARENT-WRAPPER').on( 'click', '.jet-listing-dynamic-link__link', function() {
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.