Javascript modal showing when commented out

  bootstrap-modal, javascript

I have a some javascript written that a modal will pop up when a button is pressed. The issue I am having is when I comment out the line that calls to show the modal it still shows up on that button click.

if (!data.error){
     if (the_drugName !== null) {
                                                    
        document.getElementById('exampleModalLabel').innerHTML = "Enter all of the Diet values for Drug " + the_drugName;
        
         //below line is the one getting commented out but modal still shows
        $("#exampleModal").modal("show");
     }
     } else {
          alert ("Error occured please set a new drug name.")
     }

     $(document).on('hidden.bs.modal', '#exampleModal', function () {
          window.location = 'feedsequencing.php';
     });

Source: Ask Javascript Questions

LEAVE A COMMENT