• Trying to run simple Custom JavaScript, but it doesn’t work Before Load, or After Load. No warning/errors are showing up in the Browser Console. Does not work on any platform, or browser.

    I can clearly see the Custom Code loaded into the browser source:

    <script type='text/javascript' id='berocket_lmp_js-js-extra'>
    /* <![CDATA[ */
    var the_lmp_js_data = {"type":"pagination","update_url":"1","use_mobile":"","mobile_type":"","mobile_width":"","is_AAPF":"1","buffer":"50","use_prev_btn":"","load_image":"<div class=\"lmp_products_loading\"><i class=\"fa fa-spinner lmp_rotate\"><\/i><span class=\"\"><\/span><\/div>","load_img_class":".lmp_products_loading","load_more":"<div class=\"lmp_load_more_button br_lmp_button_settings\"><a class=\"lmp_button \" style=\"font-size: 22px;color: #333333;background-color: #aaaaff;padding-top:15px;padding-right:25px;padding-bottom:15px;padding-left:25px;margin-top:px;margin-right:px;margin-bottom:px;margin-left:px; border-top: 0px solid #000; border-bottom: 0px solid #000; border-left: 0px solid #000; border-right: 0px solid #000; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;\" href=\"#load_next_page\">Load More<\/a><\/div>","load_prev":"<div class=\"lmp_load_more_button br_lmp_prev_settings\"><a class=\"lmp_button \" style=\"font-size: 22px;color: #333333;background-color: #aaaaff;padding-top:15px;padding-right:25px;padding-bottom:15px;padding-left:25px;margin-top:px;margin-right:px;margin-bottom:px;margin-left:px; border-top: 0px solid #000; border-bottom: 0px solid #000; border-left: 0px solid #000; border-right: 0px solid #000; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;\" href=\"#load_next_page\">Load Previous<\/a><\/div>","lazy_load":"","lazy_load_m":"","LLanimation":"","end_text":"<div class=\"lmp_products_loading\"><span class=\"\"><\/span><\/div>","javascript":{"before_update":"alert('test');","after_update":"alert('test');"},"products":"ul.products","item":"li.product","pagination":".woocommerce-pagination","next_page":".woocommerce-pagination a.next","prev_page":".woocommerce-pagination a.prev"};
    /* ]]> */
    </script>

    However, nothing works before load or after load no matter what code is entered. Just trying to do a simple alert(); currently.

    Wordpress Version: 6.0.0
    Plugin Version: 1.1.9.4

    • This topic was modified 2 years, 9 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dmytro Holovnia

    (@dholovnia)

    Please provide your site url.

    Regards,
    Dmytro

    Thread Starter dramage

    (@dramage)

    Hello,

    Currently working on [ redundant link removed ]

    • This reply was modified 2 years, 9 months ago by Jan Dembowski.
    Thread Starter dramage

    (@dramage)

    Hello,

    I have found the culprit I believe. The JavaScript Code appears to be overwritten by the BeRocket Product Filters Plugin.

    I recently added the widget for this plugin, which appears to be what broke the structure that was originally in place. JavaScript will no longer be executed out of the Load More Products Plugin. If I put the JavaScript for After Update into the Product Filters Plugin, all appears to work perfectly.

    I suppose that makes sense when you think about it.

    For future reference, is there any documentation that shows the hierarchy in which what plugins will override the others? This might make it easier to track down issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Javascript not working’ is closed to new replies.