Inconsistency with window.history.back()

前端 未结 2 749
梦如初夏
梦如初夏 2021-01-13 23:02

I have the following code in an MVC view that I\'m using to test window.history.back()

\"enter

2条回答
  •  长发绾君心
    2021-01-13 23:41

    The browser is probably interpreting the button as a submit button and submitting the form, thus causing a page refresh. Adding type="button" will prevent that.

    
    

提交回复
热议问题