document.location.href=history.back()这样写也行?你直接写history.back()不就完了

解决方案 »

  1.   

    history.back()是方法,不是属性,没有返回值。
    For security reasons, the history object does not expose the actual URLs in the browser history. It does allow navigation through the browser history by exposing the back, forward, and go methods. A particular document in the browser history can be identified as an index relative to the current page. For example, specifying -1 as a parameter for the go method is the equivalent of clicking the Back button.
      

  2.   

    window.history.back()
    window.location.go(-1)