How to fix AJAX to always fire when checking box?

前端 未结 3 1081
走了就别回头了
走了就别回头了 2021-01-17 06:38

Sometimes this AJAX fires & sometimes it doesn\'t, let me explain.

habit.js

$(document).ready(function()
{
  $(\".habit-check\")         


        
3条回答
  •  遇见更好的自我
    2021-01-17 07:16

    This might be the problem with Turbolinks, could you try changing your javascript:

    $(document).ready(function()
    {
      // ...
    }
    

    to look like:

    $(document).on("ready page:load", function() {
      // ..
    }
    

    Please, let me know if it helped!

    Good luck!

提交回复
热议问题