We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes. Online Storeįor orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to address the inquiry and respond to the question. To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including: Questions and Inquiriesįor inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. Please note that other Pearson websites and online products and services have their own separate privacy policies. This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site. This will create a fairly fast scroll in the status bar. The length of the pause is 50 milliseconds.
In this line, you're telling setTimeout to call the scrollMsg function after a brief wait. Inside the parentheses, you put the name of the function you want to call after the pause, add a comma to separate the name from the time period, then add the time period in milliseconds. The setTimeout command is JavaScript's way of adding a pause to a process. If the value of i is the same or greater than myMsg, then set i back to zero. If the value of i is less than the length of the variable myMsg, then add 1 to the value of i. As i increases, the first instance of substring() gets progressively smaller and the second instance gets progressively larger.įor example, if myMsg was "howdy," and i was 3, the first instance of substring() would be " dy" and the second instance of substring() would be "how." Then, when i was incremented to 4, the first instance would be "y" and the second instance would be "howd." Therefore, the status line would go from "dyhow" to "yhowd" to "howdy." Remember, JavaScript strings start at 0, not 1. The result is then concatenated with the second instance of substring(), which has gotten the left half of myMsg, starting at position 0 and continuing up for i characters.
This instance first gets the right half of myMsg, starting at position i and continuing to the end of the string. So, in this line, the first instance of substring() is grabbing a part of myMsg, starting at i and ending at 56 (the number of characters in the string). The method substring(x,y) acts on an object, in this case the string myMsg, and returns part of the string, starting with the character at x and continuing for y characters. The scrolling message is set up by splitting myMsg into two parts. In other words, it's the line at the bottom of your browser window that shows your current status. This sets window.status, the status line property of the window object. This line creates a function called scrollMsg. In this line, i is being initialized (or created) with an initial value of zero.
Throughout this script, i will increase in value and then be set back to zero, depending on what part of the script is executing. The variable i is traditionally used by programmers to denote a variable used as a counter. This line sets the variable myMsg to the text within the quotes. Figure 3.19 Note the message scrolling in the status bar at the bottom of this window.