Học JavaScript qua ví dụ part 2 ppt
... recommended in late 1998. DOM Level 2 was published in late 20 00. The cur- rent release of the DOM specification was published in April 20 04. By 20 05, large parts of W3C DOM were well supported ... ECMA -25 2 edition 5, see http://www.ecmas- cript.org/. 1.9.1 JavaScript Objects Everything you do in JavaScript involves objects, just as everything you do in real life involves obje...
Ngày tải lên: 04/07/2014, 02:20
... shown in Example 2. 4 and Figures 2. 9, 2. 10, and 2. 11. FORMAT JavaScript: expression EXAMPLE 2. 4 JavaScript: 5 + 4 Figure 2. 9 Internet Explorer and the JavaScript: protocol. Figure 2. 10 Mozilla Firefox ... <script type="text /javascript& quot;> 2 <! Hiding JavaScript from Older Browsers 3 document.write("<h2>Welcome to Maine!</h2>"); 4...
Ngày tải lên: 04/07/2014, 02:20
... sequences are a mechanism for quoting a single character. EXAMPLE 3.1 123 45 integer 23 .45 float .23 4E -2 scientific notation .23 4e+3 scientific notation 0x456fff hexadecimal 0x456FFF hexadecimal 0777 ... numbers such as 123 .56 or 2. 5. They must contain a decimal point or an exponent specifier, such as 1.3e 2. The letter “e” for expo- nent notation can be either uppercase or lo...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 9 pptx
... a variable. JavaScript declares constants with the const type (which replaces var) and the name of the constant is in </body> </html> Output: 3 25 cats 4 almost 25 5 29 6 510 years 7 ... <head><title>Using the const Keyword</title> <script type="text /javascript& quot;> 1 const NOON = 12; 2 const FREEZING = 32; // Can't change </sc...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 16 pptx
... argument2, ); // function call (caller) function_name(parameter1, parameter2 ){ // function definition (receiver) var result= parameter1 + parameter2; } // curly braces required Figure 7 .2 After ... anywhere. Function definitions are often stored in external JavaScript files or libraries (see JavaScript from External Files” on page 22 of Chapter 1). To define a function, the functi...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 18 pptx
... previous numbers together; so 0 + 1 is 1, 1 + 1 is 2, 1 + 2 is 3, 2 + 3 is 5, and so on. In Example 7.10, the Fibonacci sequence recurses 20 times and as you can see, if these numbers represent ... type="text /javascript& quot;> 1 var count = 0; 2 function fib(num){ 3 count++; switch(num){ case 0 : 4 return(0); break; case 1: 5 return(1); break; default: 6 return(fib(nu...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 29 ppt
... ptg 25 6 Chapter 9 • JavaScript Core Objects EXAMPLE 9 .28 <html> <head><title>String Manipulation</title></head> <body> <h2>Working with ... Substr method returns 5 characters. Figure 9.33 Output from Example 9 .28 . From the Library of WoweBook.Com ptg 25 2 Chapter 9 • JavaScript Core Objects String.bold() <b>String</b> String...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 31 ppt
... Internet Explorer and Firefox > <h2>Flash swf file As Object</h2> 1 <object width=" ;25 0" height="100" 2 classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ... .wav, .pdf, and so on. Partial output is shown in Figure 10.15. Figure 10.15 MIME types: Output from Example 10.6 (partial list). From the Library of WoweBook.Com ptg 28 2 Chapter...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 34 ppt
... 310.) FORMAT JavaScript: window.location.href = "URL"; JavaScript: window.location.replace("URL"); EXAMPLE JavaScript: window.location.href = "http://www.legos.com/"; JavaScript: ... display is shown in Figure 10 .28 on page 311. EXAMPLE 10.17 (CONTINUED) From the Library of WoweBook.Com ptg 10.1 JavaScript and the Browser Object Model 311 JavaScript co...
Ngày tải lên: 04/07/2014, 02:20
Học JavaScript qua ví dụ part 43 ppt
... text in a textbox with JavaScript. 19. What the blur() and focus() methods do. 20 . How to use multiple selects. 21 . How the selectedIndex property works with drop-down menus. 22 . How to test for ... Input Devices EXAMPLE 11 .29 <html> <head><title>Verifying a Password</title> <script type="text /javascript& quot;> 1 function valid(form){ 2 if( f...
Ngày tải lên: 04/07/2014, 02:20