Jump to content
Larry Ullman's Book Forums
berkeleyguy

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

Share this post


Link to post
Share on other sites

Yeah, that's a mistake on my part. Apologies for that and thanks for bringing it up. I'll look into getting that corrected. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...