0

I have used the following script in a .phtml file

      require([
        'jquery'

], function ($) {
    $('#update-shipping-method-submit').trigger('click');

});

My issue is after loading of page is keeps on clicking & reloading, I want to click this id only once after page load.

1 Answer 1

0

Please try with this code, hope its work for you.

$(document).ajaxComplete(function() {
       // enter your code here.
});
1
  • require([ 'jquery' ], function ($) { $(document).ajaxComplete(function() { $('#update-shipping-method-submit').trigger('click'); }); }); I tried still same
    – Arjun
    Jul 22, 2019 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.