Jump to content
Larry Ullman's Book Forums

Typo: Page 344: Window.print(); Should Be Window.history.back();


Recommended Posts

On Page 344, right after on page 343 at the very end it states "as a practical example of this, let's return to the idea of linking some text to the browser's Back button, via the window.history.back() method", the following code appears:

 

Please <span id=backSpan">go back</span> to the previous window and do what needs to be done.

 

window.onload = function() {

   if (typeof window.print == 'function') {

      var backSpan = document.getElementById('backSpan');

      backSpan.onclick = function() {

          window.print();

      }

   }

};

 

Shouldn't the window.print(); be replaced with "window.history.back()", given that page 343 at the end mentions using an example of window.history.back(), not of window.print(); ?

 

Thank you for your help in advance,

 

Alexander

Link to comment
Share on other sites

 Share

×
×
  • Create New...