search

Home  >  Q&A  >  body text

alert("Hello JavaScript");

The same function can be achieved without alert("Hello JavaScript");. Why must this code be added?

自律者自由自律者自由2582 days ago1585

reply all(3)I'll reply

  • 有人@我

    有人@我2017-12-25 17:42:51

    It is only used for debugging the code. You can also use console.log. Alert also has a function, which is to give prompt information to website users when they click certain buttons or information, so that users know where the operation is wrong. However, Nowadays, everyone uses layer pop-ups

    reply
    0
  • nearest

    nearest2017-10-26 00:04:19

    Is to test whether your js is executed normally

    reply
    1
  • 路过

    路过2017-10-25 13:01:51

    This is debugging information, delete it if you are sure the program is useless

    reply
    0
  • Cancelreply