test.html 515 B

12345678910111213141516171819202122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>test</title>
  6. <script src="../../../lib/jquery/jquery.min.js"></script>
  7. </head>
  8. <body>
  9. <div id="di">ss</div>
  10. </body>
  11. <script>
  12. $(document).ready(function(){
  13. var test = ['a', 'b', 'c', 'd'];
  14. var index = test.indexOf('b');
  15. console.log(test);
  16. console.log('index: '+index);
  17. //test.splice(index, 1);
  18. test.splice(index, 0, 'vvvvv');
  19. console.log(test);
  20. });
  21. </script>
  22. </html>