• Resolved philipo

    (@timov93)


    Dear Support Team,

    I hope this message finds you well. I’m writing to report an issue I’ve encountered while using your caching plugin on my website.

    I have a custom search bar on my website. Apparently, there is a JavaScript conflict that I cannot identify the cause of. When attempting to clear the cache on my site, I receive an alert “Error: undefined c is undefined.” I am attaching my code that works with my search bar and kindly request assistance in identifying what might be causing the conflict with your plugin.

    function fetch(){
    	
    	jQuery('#svgLoad').show(); 
        jQuery.ajax({
            url: '<?php echo admin_url('admin-ajax.php'); ?>',
            type: 'post',
            data: { action: 'data_fetch', keyword: jQuery('#is-search-input-93119').val() },
    
            success: function(data) {
            	
    
                jQuery('#datafetch').html( data );
                jQuery('#svgLoad').hide(0); 
    
            }
        });
    
    }

    Best regards, Ivan

    • This topic was modified 2 years, 2 months ago by philipo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter philipo

    (@timov93)

    I’ve successfully identified the issue. Upon reviewing your code, I noticed that a function with the same name was being used. By simply renaming my function, I was able to resolve the conflict. Everything is now functioning as expected.

    Plugin Contributor iSaumya

    (@isaumya)

    Glad to know that the issue has been resolved now. 🙂

    BTW, it is very risky to have a function named fetch as it’s a reserved keyword of JavaScript and also a native Javascript function name. Learn more: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch

    Hope this helps.

    • This reply was modified 2 years, 2 months ago by iSaumya. Reason: Adding more info
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Issue with Alert Popup When Using Search Script’ is closed to new replies.