conflicting jquery scripts in Node js project(model.show()) not workingIs there an “exists” function for jQuery?How do JavaScript closures work?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?

Efficient deletion of specific list entries

Subnumcases as a part of align

The selling of the sheep

Why are condenser mics so much more expensive than dynamics?

Can an Iranian citizen enter the USA on a Dutch passport?

How to preserve a rare version of a book?

Primes in a Diamond

What does the phrase "go for the pin" mean here?

Which "exotic salt" can lower water's freezing point by –70 °C?

How long did it take Captain Marvel to travel to Earth?

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

What is the thing used to help pouring liquids called?

Has the United States ever had a non-Christian President?

Python 3 - simple temperature program version 1.3

Is it normal for gliders not to have attitude indicators?

Debian 9 server no sshd in auth.log

What is the meaning of 「隣のおじいさんは言いました」

HSA - Continue to Invest?

What does the copyright in a dissertation protect exactly?

As a GM, is it bad form to ask for a moment to think when improvising?

Given a safe domain, are subdirectories safe as well?

What does the coin flipping before dying mean?

Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?

What is monoid homomorphism exactly?



conflicting jquery scripts in Node js project(model.show()) not working


Is there an “exists” function for jQuery?How do JavaScript closures work?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to show a model but the model.show is not working. I have seen a similar problem asked here but I was not able to solve my issue.
my html code:



<table class="table table-bordered" id="mytable">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">Username</th>
<th scope="col">Location</th>
<th scope="col">House Number</th>
<th scope="col" >Action</th>
</tr>
</thead>
<% var c=0; for(var i=0; i < data.length; i++) c++; %>
<tbody>
<tr>
<th scope="row"><%= c %></th>
<td><%= data[i].user_name %></td>
<td><%= data[i].location %></td>
<td><%= data[i].house_number %></td>
<td>
<a href="#" class="btn btn-success" >Edit</a>
<!-- <a href="javascript:void(0);" id="myDelete" data-toggle="modal" data-target="#myDeleteModal" class="btn btn-sm btn-danger myDelete" data-userid="<%= data[i].user_id %>">
<%= data[i].user_id %>Delete
</a> -->
<a href="javascript:void(0);" class="btn btn-sm btn-danger delete" data-id="<%= data[i].user_id %>">Delete</a>
</td>
</tr>
</tbody>
<% %>
</table>


my model



<!-- Delete Product Modal-->
<form id="add-row-form" action="/delete" method="post">
<div class="modal fade" id="DeleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="myModalLabel">Delete Product</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
</div>
<div class="modal-body">
<strong>Are You Sure To Delete This Data?</strong>
</div>
<div class="modal-footer">
<input name="product_id" class="form-control product_id2" required>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success">Delete</button>
</div>
</div>
</div>
</div>
</form>


my scripts.



<script src="bower_components/vendors/jquery/dist/jquery.min.js"></script>
<script src="bower_components/vendors/popper.js/dist/umd/popper.min.js"></script>
<script src="bower_components/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="bower_components/assets/js/main.js"></script>


<script src="bower_components/vendors/chart.js/dist/Chart.bundle.min.js"></script>
<script src="bower_components/assets/js/dashboard.js"></script>
jquery
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<!-- Vue -->
<script src="bower_components/assets/js/Vue.js"></script>
<!-- custom myscript.js -->
<script src="bower_components/assets/js/myscript.js"></script>
<script src="bower_components/assets/js/widgets.js"></script>
<script src="bower_components/vendors/jqvmap/dist/jquery.vmap.min.js"></script>
<script src="bower_components/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
<script src="bower_components/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
<script>
(function($)
"use strict";

jQuery('#vmap').vectorMap(
map: 'world_en',
backgroundColor: null,
color: '#ffffff',
hoverOpacity: 0.7,
selectedColor: '#1de9b6',
enableZoom: true,
showTooltip: true,
values: sample_data,
scaleColors: ['#1de9b6', '#03a9f5'],
normalizeFunction: 'polynomial'
);
)(jQuery);
</script>
<script>
$(document).ready(function()
//showing data to modal for edit record
$('#mytable').on('click','.edit',function()
var product_id = $(this).data('id');
var product_name = $(this).data('product_name');
var product_price = $(this).data('product_price');
$('#EditModal').modal('show');
$('.product_name').val(product_name);
$('.price').val(product_price);
$('.product_id').val(product_id);
);
//showing modal for delete record
$('#mytable').on('click','.delete',function()
$(this).hide();
var product_id = $(this).data('id');
$('#DeleteModal').modal('show');
$('.product_id2').val(product_id);
);

);
</script>


im not sure if its because of the the conflicting licks to jquerys as pointed by some people in similar question or maybe doing somewhere wrong.










share|improve this question




























    0















    I am trying to show a model but the model.show is not working. I have seen a similar problem asked here but I was not able to solve my issue.
    my html code:



    <table class="table table-bordered" id="mytable">
    <thead class="thead-dark">
    <tr>
    <th scope="col">#</th>
    <th scope="col">Username</th>
    <th scope="col">Location</th>
    <th scope="col">House Number</th>
    <th scope="col" >Action</th>
    </tr>
    </thead>
    <% var c=0; for(var i=0; i < data.length; i++) c++; %>
    <tbody>
    <tr>
    <th scope="row"><%= c %></th>
    <td><%= data[i].user_name %></td>
    <td><%= data[i].location %></td>
    <td><%= data[i].house_number %></td>
    <td>
    <a href="#" class="btn btn-success" >Edit</a>
    <!-- <a href="javascript:void(0);" id="myDelete" data-toggle="modal" data-target="#myDeleteModal" class="btn btn-sm btn-danger myDelete" data-userid="<%= data[i].user_id %>">
    <%= data[i].user_id %>Delete
    </a> -->
    <a href="javascript:void(0);" class="btn btn-sm btn-danger delete" data-id="<%= data[i].user_id %>">Delete</a>
    </td>
    </tr>
    </tbody>
    <% %>
    </table>


    my model



    <!-- Delete Product Modal-->
    <form id="add-row-form" action="/delete" method="post">
    <div class="modal fade" id="DeleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-header">
    <h5 class="modal-title" id="myModalLabel">Delete Product</h5>
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    </div>
    <div class="modal-body">
    <strong>Are You Sure To Delete This Data?</strong>
    </div>
    <div class="modal-footer">
    <input name="product_id" class="form-control product_id2" required>
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    <button type="submit" class="btn btn-success">Delete</button>
    </div>
    </div>
    </div>
    </div>
    </form>


    my scripts.



    <script src="bower_components/vendors/jquery/dist/jquery.min.js"></script>
    <script src="bower_components/vendors/popper.js/dist/umd/popper.min.js"></script>
    <script src="bower_components/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="bower_components/assets/js/main.js"></script>


    <script src="bower_components/vendors/chart.js/dist/Chart.bundle.min.js"></script>
    <script src="bower_components/assets/js/dashboard.js"></script>
    jquery
    <script src="bower_components/jquery/dist/jquery.min.js"></script>
    <!-- Vue -->
    <script src="bower_components/assets/js/Vue.js"></script>
    <!-- custom myscript.js -->
    <script src="bower_components/assets/js/myscript.js"></script>
    <script src="bower_components/assets/js/widgets.js"></script>
    <script src="bower_components/vendors/jqvmap/dist/jquery.vmap.min.js"></script>
    <script src="bower_components/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
    <script src="bower_components/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
    <script>
    (function($)
    "use strict";

    jQuery('#vmap').vectorMap(
    map: 'world_en',
    backgroundColor: null,
    color: '#ffffff',
    hoverOpacity: 0.7,
    selectedColor: '#1de9b6',
    enableZoom: true,
    showTooltip: true,
    values: sample_data,
    scaleColors: ['#1de9b6', '#03a9f5'],
    normalizeFunction: 'polynomial'
    );
    )(jQuery);
    </script>
    <script>
    $(document).ready(function()
    //showing data to modal for edit record
    $('#mytable').on('click','.edit',function()
    var product_id = $(this).data('id');
    var product_name = $(this).data('product_name');
    var product_price = $(this).data('product_price');
    $('#EditModal').modal('show');
    $('.product_name').val(product_name);
    $('.price').val(product_price);
    $('.product_id').val(product_id);
    );
    //showing modal for delete record
    $('#mytable').on('click','.delete',function()
    $(this).hide();
    var product_id = $(this).data('id');
    $('#DeleteModal').modal('show');
    $('.product_id2').val(product_id);
    );

    );
    </script>


    im not sure if its because of the the conflicting licks to jquerys as pointed by some people in similar question or maybe doing somewhere wrong.










    share|improve this question
























      0












      0








      0








      I am trying to show a model but the model.show is not working. I have seen a similar problem asked here but I was not able to solve my issue.
      my html code:



      <table class="table table-bordered" id="mytable">
      <thead class="thead-dark">
      <tr>
      <th scope="col">#</th>
      <th scope="col">Username</th>
      <th scope="col">Location</th>
      <th scope="col">House Number</th>
      <th scope="col" >Action</th>
      </tr>
      </thead>
      <% var c=0; for(var i=0; i < data.length; i++) c++; %>
      <tbody>
      <tr>
      <th scope="row"><%= c %></th>
      <td><%= data[i].user_name %></td>
      <td><%= data[i].location %></td>
      <td><%= data[i].house_number %></td>
      <td>
      <a href="#" class="btn btn-success" >Edit</a>
      <!-- <a href="javascript:void(0);" id="myDelete" data-toggle="modal" data-target="#myDeleteModal" class="btn btn-sm btn-danger myDelete" data-userid="<%= data[i].user_id %>">
      <%= data[i].user_id %>Delete
      </a> -->
      <a href="javascript:void(0);" class="btn btn-sm btn-danger delete" data-id="<%= data[i].user_id %>">Delete</a>
      </td>
      </tr>
      </tbody>
      <% %>
      </table>


      my model



      <!-- Delete Product Modal-->
      <form id="add-row-form" action="/delete" method="post">
      <div class="modal fade" id="DeleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
      <div class="modal-content">
      <div class="modal-header">
      <h5 class="modal-title" id="myModalLabel">Delete Product</h5>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      </div>
      <div class="modal-body">
      <strong>Are You Sure To Delete This Data?</strong>
      </div>
      <div class="modal-footer">
      <input name="product_id" class="form-control product_id2" required>
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="submit" class="btn btn-success">Delete</button>
      </div>
      </div>
      </div>
      </div>
      </form>


      my scripts.



      <script src="bower_components/vendors/jquery/dist/jquery.min.js"></script>
      <script src="bower_components/vendors/popper.js/dist/umd/popper.min.js"></script>
      <script src="bower_components/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
      <script src="bower_components/assets/js/main.js"></script>


      <script src="bower_components/vendors/chart.js/dist/Chart.bundle.min.js"></script>
      <script src="bower_components/assets/js/dashboard.js"></script>
      jquery
      <script src="bower_components/jquery/dist/jquery.min.js"></script>
      <!-- Vue -->
      <script src="bower_components/assets/js/Vue.js"></script>
      <!-- custom myscript.js -->
      <script src="bower_components/assets/js/myscript.js"></script>
      <script src="bower_components/assets/js/widgets.js"></script>
      <script src="bower_components/vendors/jqvmap/dist/jquery.vmap.min.js"></script>
      <script src="bower_components/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
      <script src="bower_components/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
      <script>
      (function($)
      "use strict";

      jQuery('#vmap').vectorMap(
      map: 'world_en',
      backgroundColor: null,
      color: '#ffffff',
      hoverOpacity: 0.7,
      selectedColor: '#1de9b6',
      enableZoom: true,
      showTooltip: true,
      values: sample_data,
      scaleColors: ['#1de9b6', '#03a9f5'],
      normalizeFunction: 'polynomial'
      );
      )(jQuery);
      </script>
      <script>
      $(document).ready(function()
      //showing data to modal for edit record
      $('#mytable').on('click','.edit',function()
      var product_id = $(this).data('id');
      var product_name = $(this).data('product_name');
      var product_price = $(this).data('product_price');
      $('#EditModal').modal('show');
      $('.product_name').val(product_name);
      $('.price').val(product_price);
      $('.product_id').val(product_id);
      );
      //showing modal for delete record
      $('#mytable').on('click','.delete',function()
      $(this).hide();
      var product_id = $(this).data('id');
      $('#DeleteModal').modal('show');
      $('.product_id2').val(product_id);
      );

      );
      </script>


      im not sure if its because of the the conflicting licks to jquerys as pointed by some people in similar question or maybe doing somewhere wrong.










      share|improve this question














      I am trying to show a model but the model.show is not working. I have seen a similar problem asked here but I was not able to solve my issue.
      my html code:



      <table class="table table-bordered" id="mytable">
      <thead class="thead-dark">
      <tr>
      <th scope="col">#</th>
      <th scope="col">Username</th>
      <th scope="col">Location</th>
      <th scope="col">House Number</th>
      <th scope="col" >Action</th>
      </tr>
      </thead>
      <% var c=0; for(var i=0; i < data.length; i++) c++; %>
      <tbody>
      <tr>
      <th scope="row"><%= c %></th>
      <td><%= data[i].user_name %></td>
      <td><%= data[i].location %></td>
      <td><%= data[i].house_number %></td>
      <td>
      <a href="#" class="btn btn-success" >Edit</a>
      <!-- <a href="javascript:void(0);" id="myDelete" data-toggle="modal" data-target="#myDeleteModal" class="btn btn-sm btn-danger myDelete" data-userid="<%= data[i].user_id %>">
      <%= data[i].user_id %>Delete
      </a> -->
      <a href="javascript:void(0);" class="btn btn-sm btn-danger delete" data-id="<%= data[i].user_id %>">Delete</a>
      </td>
      </tr>
      </tbody>
      <% %>
      </table>


      my model



      <!-- Delete Product Modal-->
      <form id="add-row-form" action="/delete" method="post">
      <div class="modal fade" id="DeleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
      <div class="modal-content">
      <div class="modal-header">
      <h5 class="modal-title" id="myModalLabel">Delete Product</h5>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      </div>
      <div class="modal-body">
      <strong>Are You Sure To Delete This Data?</strong>
      </div>
      <div class="modal-footer">
      <input name="product_id" class="form-control product_id2" required>
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      <button type="submit" class="btn btn-success">Delete</button>
      </div>
      </div>
      </div>
      </div>
      </form>


      my scripts.



      <script src="bower_components/vendors/jquery/dist/jquery.min.js"></script>
      <script src="bower_components/vendors/popper.js/dist/umd/popper.min.js"></script>
      <script src="bower_components/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
      <script src="bower_components/assets/js/main.js"></script>


      <script src="bower_components/vendors/chart.js/dist/Chart.bundle.min.js"></script>
      <script src="bower_components/assets/js/dashboard.js"></script>
      jquery
      <script src="bower_components/jquery/dist/jquery.min.js"></script>
      <!-- Vue -->
      <script src="bower_components/assets/js/Vue.js"></script>
      <!-- custom myscript.js -->
      <script src="bower_components/assets/js/myscript.js"></script>
      <script src="bower_components/assets/js/widgets.js"></script>
      <script src="bower_components/vendors/jqvmap/dist/jquery.vmap.min.js"></script>
      <script src="bower_components/vendors/jqvmap/examples/js/jquery.vmap.sampledata.js"></script>
      <script src="bower_components/vendors/jqvmap/dist/maps/jquery.vmap.world.js"></script>
      <script>
      (function($)
      "use strict";

      jQuery('#vmap').vectorMap(
      map: 'world_en',
      backgroundColor: null,
      color: '#ffffff',
      hoverOpacity: 0.7,
      selectedColor: '#1de9b6',
      enableZoom: true,
      showTooltip: true,
      values: sample_data,
      scaleColors: ['#1de9b6', '#03a9f5'],
      normalizeFunction: 'polynomial'
      );
      )(jQuery);
      </script>
      <script>
      $(document).ready(function()
      //showing data to modal for edit record
      $('#mytable').on('click','.edit',function()
      var product_id = $(this).data('id');
      var product_name = $(this).data('product_name');
      var product_price = $(this).data('product_price');
      $('#EditModal').modal('show');
      $('.product_name').val(product_name);
      $('.price').val(product_price);
      $('.product_id').val(product_id);
      );
      //showing modal for delete record
      $('#mytable').on('click','.delete',function()
      $(this).hide();
      var product_id = $(this).data('id');
      $('#DeleteModal').modal('show');
      $('.product_id2').val(product_id);
      );

      );
      </script>


      im not sure if its because of the the conflicting licks to jquerys as pointed by some people in similar question or maybe doing somewhere wrong.







      javascript jquery html






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 23 at 4:34









      tenchotencho

      198




      198






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Your selector is wrong, try setting it this way:



          $(document).ready(function()
          //showing data to modal for edit record
          $('#mytable .edit').on('click', function()
          var product_id = $(this).data('id');
          var product_name = $(this).data('product_name');
          var product_price = $(this).data('product_price');
          $('#EditModal').modal('show');
          $('.product_name').val(product_name);
          $('.price').val(product_price);
          $('.product_id').val(product_id);
          );
          //showing modal for delete record
          $('#mytable .delete').on('click',function()
          $(this).hide();
          var product_id = $(this).data('id');
          $('#DeleteModal').modal('show');
          $('.product_id2').val(product_id);
          );

          );





          share|improve this answer























          • No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

            – tencho
            Mar 23 at 4:51











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310638%2fconflicting-jquery-scripts-in-node-js-projectmodel-show-not-working%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Your selector is wrong, try setting it this way:



          $(document).ready(function()
          //showing data to modal for edit record
          $('#mytable .edit').on('click', function()
          var product_id = $(this).data('id');
          var product_name = $(this).data('product_name');
          var product_price = $(this).data('product_price');
          $('#EditModal').modal('show');
          $('.product_name').val(product_name);
          $('.price').val(product_price);
          $('.product_id').val(product_id);
          );
          //showing modal for delete record
          $('#mytable .delete').on('click',function()
          $(this).hide();
          var product_id = $(this).data('id');
          $('#DeleteModal').modal('show');
          $('.product_id2').val(product_id);
          );

          );





          share|improve this answer























          • No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

            – tencho
            Mar 23 at 4:51















          0














          Your selector is wrong, try setting it this way:



          $(document).ready(function()
          //showing data to modal for edit record
          $('#mytable .edit').on('click', function()
          var product_id = $(this).data('id');
          var product_name = $(this).data('product_name');
          var product_price = $(this).data('product_price');
          $('#EditModal').modal('show');
          $('.product_name').val(product_name);
          $('.price').val(product_price);
          $('.product_id').val(product_id);
          );
          //showing modal for delete record
          $('#mytable .delete').on('click',function()
          $(this).hide();
          var product_id = $(this).data('id');
          $('#DeleteModal').modal('show');
          $('.product_id2').val(product_id);
          );

          );





          share|improve this answer























          • No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

            – tencho
            Mar 23 at 4:51













          0












          0








          0







          Your selector is wrong, try setting it this way:



          $(document).ready(function()
          //showing data to modal for edit record
          $('#mytable .edit').on('click', function()
          var product_id = $(this).data('id');
          var product_name = $(this).data('product_name');
          var product_price = $(this).data('product_price');
          $('#EditModal').modal('show');
          $('.product_name').val(product_name);
          $('.price').val(product_price);
          $('.product_id').val(product_id);
          );
          //showing modal for delete record
          $('#mytable .delete').on('click',function()
          $(this).hide();
          var product_id = $(this).data('id');
          $('#DeleteModal').modal('show');
          $('.product_id2').val(product_id);
          );

          );





          share|improve this answer













          Your selector is wrong, try setting it this way:



          $(document).ready(function()
          //showing data to modal for edit record
          $('#mytable .edit').on('click', function()
          var product_id = $(this).data('id');
          var product_name = $(this).data('product_name');
          var product_price = $(this).data('product_price');
          $('#EditModal').modal('show');
          $('.product_name').val(product_name);
          $('.price').val(product_price);
          $('.product_id').val(product_id);
          );
          //showing modal for delete record
          $('#mytable .delete').on('click',function()
          $(this).hide();
          var product_id = $(this).data('id');
          $('#DeleteModal').modal('show');
          $('.product_id2').val(product_id);
          );

          );






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 4:46









          Irene MitchellIrene Mitchell

          443




          443












          • No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

            – tencho
            Mar 23 at 4:51

















          • No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

            – tencho
            Mar 23 at 4:51
















          No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

          – tencho
          Mar 23 at 4:51





          No, the selector is working fine because when i try to hide the button before model('show'), it works fine, but after that its not working.

          – tencho
          Mar 23 at 4:51



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310638%2fconflicting-jquery-scripts-in-node-js-projectmodel-show-not-working%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?