tailieunhanh - JavaScript Bible, Gold Edition part 10
JavaScript Bible, Gold Edition part 10. This book will bring programmers and non-technical professionals, including casual programmers and scripters, painlessly up to speed on all aspects of mastering JavaScript. Key topics include programming fundamentals, JavaScript language elements and how to use them effectively, and how to easily and efficiently add powerful new functionality to HTML documents and Java applets. | CD-20 Part II JavaScript Tutorial The first is a scripted way of clicking a Submit button to send a form named orderForm to a server. The second selects the text inside a text field named entry which is contained by a form named orderForm . Sometimes a method requires that you send additional information with it so that it can do its job. Each chunk of information passed with the method is called a parameter or argument you can use the terms interchangeably . You saw examples of passing a parameter in your first script in Chapter 3. Two script statements invoked the write method of the document object This browser is version of B B . As the page loaded into the browser each method sent whatever text was inside the parentheses to the current document. In both cases the content being sent as a parameter consisted of straight text inside quotes and the values of two object properties the appVersion and appName properties of the navigator object. The navigator object does not appear in the object hierarchy diagram of Figure 4-6 because in early browsers this object exists outside of the document object model. Some methods require more than one parameter. If so the multiple parameters are separated by commas. For example Version 4 and later browsers support a window object method that moves the window to a particular coordinate point on the screen. A coordinate point is defined by two numbers that indicate the number of pixels from the left and top edges of the screen where the top-left corner of the window should be. To move the browser window to a spot 50 pixels from the left and 100 pixels from the top the method is 5Q 1QQ As you learn more about the details of JavaScript and the document objects you can script pay close attention to the range of methods defined for each object. They reveal a lot about what an .
đang nạp các trang xem trước