@@ -248,7 +248,7 @@ and, of course, plain JavaScript. To convert the list of attributes to a |
248 | 248 | list of JS events, just remove the prefixes on; for example, onclick |
249 | 249 | attribute means click event. |
250 | 250 |
|
251 | | -More information is available at Example: [Catching a mouse click](https://developer.mozilla.org/en-US/docs/JavaScript/Getting\_Started\#Example:\_Catching\_a\_mouse\_click) (https://developer.mozilla.org/en-US/docs/JavaScript/Getting\_Started\#Example:\_Catching\_a\_mouse\_click), |
| 251 | +More information is available at Example: [Catching a mouse click](https://developer.mozilla.org/en-US/docs/JavaScript/Getting_Started\#Example:_Catching_a_mouse_click) (https://developer.mozilla.org/en-US/docs/JavaScript/Getting_Started\#Example:_Catching_a_mouse_click), |
252 | 252 | [Wikipedia](http://en.wikipedia.org/wiki/HTML) (http://en.wikipedia.org/wiki/HTML) and |
253 | 253 | [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML)(https://developer.mozilla.org/en-US/docs/Web/HTML). |
254 | 254 |
|
@@ -328,7 +328,7 @@ input[name="email"] { |
328 | 328 |
|
329 | 329 |
|
330 | 330 | More information is available at Wikipedia |
331 | | -(http://en.wikipedia.org/wiki/Cascading\_Style\_Sheets) and MDN |
| 331 | +(http://en.wikipedia.org/wiki/Cascading_Style_Sheets) and MDN |
332 | 332 | (https://developer.mozilla.org/en-US/docs/Web/CSS). |
333 | 333 |
|
334 | 334 | CSS3 is an upgrade to CSS that includes new ways of doing things such as |
@@ -390,7 +390,7 @@ Other ways to run JavaScript include the following: |
390 | 390 |
|
391 | 391 | One of the advantages of the JavaScript language is that it's loosely |
392 | 392 | typed. This loose or weak typing, as opposed to strong typing |
393 | | -(http://en.wikipedia.org/wiki/Strong\_typing) in languages like C and |
| 393 | +(http://en.wikipedia.org/wiki/Strong_typing) in languages like C and |
394 | 394 | Java, makes JavaScript a better programming language for prototyping. |
395 | 395 | Here are some of the main types of JavaScript objects or classes (there |
396 | 396 | are not classes per se; objects inherit from objects). |
@@ -407,7 +407,7 @@ var num = 1 |
407 | 407 |
|
408 | 408 | This is the |
409 | 409 | [Number](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number) |
410 | | -https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global\_Objects/Number |
| 410 | +https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number |
411 | 411 |
|
412 | 412 | object and its methods; for example: |
413 | 413 |
|
@@ -429,7 +429,7 @@ var newStr = "abcde".substr(1,2) |
429 | 429 |
|
430 | 430 | For convenience, JavaScript automatically wraps string primitives with |
431 | 431 | String object methods, but they are not quite the same |
432 | | -(https://developer.mozilla.org/enUS/docs/JavaScript/Reference/Global\_Objects/String\#Distinction\_between\_string\_primitives\_and\_String\_objects). |
| 432 | +(https://developer.mozilla.org/enUS/docs/JavaScript/Reference/Global_Objects/String\#Distinction_between_string_primitives_and_String_objects). |
433 | 433 |
|
434 | 434 | ### String Object |
435 | 435 |
|
@@ -536,7 +536,7 @@ var d = new Date() //Sun May 12 2013 18:17:11 GMT-0700 (PDT) |
536 | 536 | ### Math Object |
537 | 537 |
|
538 | 538 | These are used for mathematical constants and functions |
539 | | -https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global\_Objects/Math; |
| 539 | +https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Math; |
540 | 540 | for example: |
541 | 541 |
|
542 | 542 | ```js |
@@ -578,51 +578,51 @@ In addition to classes such as `String`, `Array`, `Number`, and `Math`, which |
578 | 578 | have a lot of useful methods, you can call the following methods known |
579 | 579 | as globals, meaning you can invoke them from anywhere in your code: |
580 | 580 |
|
581 | | -- encodeURI (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/encodeURI): |
| 581 | +- encodeURI (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI): |
582 | 582 | Encodes a Uniform Resource Identifier (URI) to give you a URL, e.g., |
583 | 583 | encodeURI ('http://www.webapplog.com/js is awesome') |
584 | 584 |
|
585 | 585 | - decodeURI |
586 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/decodeURI): |
| 586 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI): |
587 | 587 | Decodes a URI |
588 | 588 |
|
589 | 589 | - encodeURIComponent |
590 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/encodeURIComponent): |
| 590 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent): |
591 | 591 | Encode URI for URL parameters (don’t use it for the entire |
592 | 592 | URL string) |
593 | 593 |
|
594 | 594 | - decodeURIComponent |
595 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/decodeURIComponent): |
| 595 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent): |
596 | 596 | Decodes the fragment |
597 | 597 |
|
598 | 598 | - isNaN ( |
599 | | - <https://developer.mozilla.org/en/docs/Web/>JavaScript/Reference/Global\_Objects/ |
| 599 | + <https://developer.mozilla.org/en/docs/Web/>JavaScript/Reference/Global_Objects/ |
600 | 600 | isNaN): Determines whether a value is a number or not |
601 | 601 |
|
602 | 602 | - [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) |
603 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/JSON): |
| 603 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON): |
604 | 604 | Parsing (parse()) and serializing (stringify()) of JSON data |
605 | 605 |
|
606 | 606 | - [parseFloat](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/parseFloat) |
607 | 607 | ( |
608 | | - https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global\_Objects/parseFloat): |
| 608 | + https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/parseFloat): |
609 | 609 | Converts a string to a floating number |
610 | 610 |
|
611 | 611 | - [parseInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) |
612 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/parseInt): |
| 612 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt): |
613 | 613 | Converts a string to a number |
614 | 614 |
|
615 | 615 | - [Intl](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl) |
616 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Intl): |
| 616 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl): |
617 | 617 | Language-specific string comparison methods |
618 | 618 |
|
619 | 619 | - Error |
620 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error): |
| 620 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error): |
621 | 621 | An error object that you can use to instantiate your own error |
622 | 622 | objects; for example, throw new Error('This book rocks!') |
623 | 623 |
|
624 | 624 | - [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) |
625 | | - (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Date): Various methods to work with dates |
| 625 | + (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date): Various methods to work with dates |
626 | 626 |
|
627 | 627 | ### Conventions |
628 | 628 |
|
@@ -646,7 +646,7 @@ function Sum(a,b) { |
646 | 646 | console.log(Sum(1, 2)) |
647 | 647 | ``` |
648 | 648 |
|
649 | | -Functions in JavaScript are first-class citizens (http://en.wikipedia.org/wiki/First-class\_function) due to the functional programming (http://en.wikipedia.org/wiki/Functional\_programming) nature of the language. Therefore, functions can be used as other variables or objects; for example, functions can be passed to other functions as arguments: |
| 649 | +Functions in JavaScript are first-class citizens (http://en.wikipedia.org/wiki/First-class_function) due to the functional programming (http://en.wikipedia.org/wiki/Functional_programming) nature of the language. Therefore, functions can be used as other variables or objects; for example, functions can be passed to other functions as arguments: |
650 | 650 |
|
651 | 651 | ```js |
652 | 652 | var f = function (str1){ |
@@ -667,7 +667,7 @@ It's good to know that there are several ways to instantiate an object in JS: |
667 | 667 | (http://javascript.info/tutorial/pseudo-classical-pattern) pattern |
668 | 668 | - Functional inheritance pattern |
669 | 669 |
|
670 | | -For further reading on inheritance patterns, check out Inheritance Patterns in JavaScript (http://bolinfest.com/javascript/inheritance.php) and Inheritance revisited (https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Inheritance\_Revisited). |
| 670 | +For further reading on inheritance patterns, check out Inheritance Patterns in JavaScript (http://bolinfest.com/javascript/inheritance.php) and Inheritance revisited (https://developer.mozilla.org/en-US/docs/JavaScript/Guide/Inheritance_Revisited). |
671 | 671 |
|
672 | 672 | More information about browser-run JavaScript is available at Mozilla Developer Network (https://developer.mozilla.org/en-US/docs/JavaScript/Reference), Wikipedia (http://en.wikipedia.org/wiki/JavaScript), and w3schools (http://www.w3schools.com/js/default.asp). |
673 | 673 |
|
@@ -754,7 +754,7 @@ In those cases where you still need your own custom server code, Node.js is the |
754 | 754 | Node.js |
755 | 755 | ------- |
756 | 756 |
|
757 | | -Node.js is an open source, event-driven asynchronous I/O technology for building scalable and efficient web servers. Node.js consists of Google’s V8 JavaScript engine (http://en.wikipedia.org/wiki/V8\_(JavaScript\_engine)). It was maintained by cloud company Joyent (http://joyent.com), but moved to the Technical Steering Committee governance. |
| 757 | +Node.js is an open source, event-driven asynchronous I/O technology for building scalable and efficient web servers. Node.js consists of Google’s V8 JavaScript engine (http://en.wikipedia.org/wiki/V8_(JavaScript_engine)). It was maintained by cloud company Joyent (http://joyent.com), but moved to the Technical Steering Committee governance. |
758 | 758 |
|
759 | 759 | The purpose and use of Node.js is similar to Twisted (<http://twistedmatrix.com/trac>) for Python and EventMachine (<http://rubyeventmachine.com>) for Ruby. The JavaScript implementation of Node was the third one after attempts at using Ruby and C++ programming languages languages. |
760 | 760 |
|
@@ -849,12 +849,12 @@ Table 1-1 is an example of a simple Create, Read, Update and Delete (CRUD) RESTf |
849 | 849 |
|
850 | 850 | REST is not a protocol; it is an architecture in the sense that it's more flexible than SOAP, which is a protocol. Therefore, REST API URLs could look like /messages/list.html or /messages/list.xml in case we want to support these formats. |
851 | 851 |
|
852 | | -PUT and DELETE are idempotent methods (http://en.wikipedia.org/wiki/Hypertext\_Transfer\_Protocol\#Idempotent\_methods\_and\_web\_applications), |
| 852 | +PUT and DELETE are idempotent methods (http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol\#Idempotent_methods_and_web_applications), |
853 | 853 | which means that if the server receives two or more similar requests, the end result will be the same. |
854 | 854 |
|
855 | 855 | GET is nullipotent and POST is not idempotent and might affect state and cause side effects. |
856 | 856 |
|
857 | | -Further reading on REST API can be found at Wikipedia (http://en.wikipedia. org/wiki/Representational\_state\_transfer) and A Brief Introduction to REST article(http://www.infoq.com/articles/rest-introduction). |
| 857 | +Further reading on REST API can be found at Wikipedia (http://en.wikipedia. org/wiki/Representational_state_transfer) and A Brief Introduction to REST article(http://www.infoq.com/articles/rest-introduction). |
858 | 858 |
|
859 | 859 | Summary |
860 | 860 | ======= |
|