[removed]; vs [removed]void(0);

后端 未结 3 1637
野趣味
野趣味 2020-12-25 12:54

I would like to know what is the difference between javascript:; and javascript:void(0); if I use them in href attribure for a

3条回答
  •  盖世英雄少女心
    2020-12-25 13:40

    Only that the latter javascript:void(0); is more readable and an accepted convention that says this code does nothing.

    It's worth noting that industry standards have come a long way regarding this syntax. You should look into Progressive Enhancement.

提交回复
热议问题