简体   繁体   中英

javascript worked on local server but not in live server 2

Below is my complete code I tried many of code in checksum but does not work on Nextraone server.

Javascript worked on local server but not in live server.

I loaded some js in local and in live. Js loaded perfectly in both server but don't know why my js is not working in live server. This is the list of js that I loaded in both servers.

 <script> $(document).ready(function() { $('input.amount').keyup(function() { calculateTotal(this); }); }); function calculateTotal(src) { var sum = 0, tbl = $(src).closest('table'); tbl.find('input.amount').each(function(index, elem) { var val = parseFloat($(elem).val()); if (!isNaN(val)) { sum += val; } }); tbl.find('.total').html(sum.toFixed(2)); } </script> <table border="1"> <tr> <td>Amount 1</td> <td><input class="amount" type="text" /></td> </tr> <tr> <td>Amount 2</td> <td><input class="amount" type="text" /></td> </tr> <tr> <td>Amount 3</td> <td><input class="amount" type="text" /></td> </tr> <tr> <td>Total Amount</td> <td><span class="total">0</span></td> </tr> </table> 

检查依赖项,例如jQuery也在服务器上加载

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM