توضیحاتی در مورد کتاب Get Programming with JavaScript
نام کتاب : Get Programming with JavaScript
عنوان ترجمه شده به فارسی : برنامه نویسی را با جاوا اسکریپت دریافت کنید
سری :
نویسندگان : John Larsen
ناشر : Manning
سال نشر :
تعداد صفحات : 436
ISBN (شابک) : 9781617293108 , 1617293105
زبان کتاب : English
فرمت کتاب : pdf
حجم کتاب : 19 مگابایت
بعد از تکمیل فرایند پرداخت لینک دانلود کتاب ارائه خواهد شد. درصورت ثبت نام و ورود به حساب کاربری خود قادر خواهید بود لیست کتاب های خریداری شده را مشاهده فرمایید.
فهرست مطالب :
Front cover\nbrief contents\ncontents\nforeword\npreface\nacknowledgments\nabout this book\n Who should read this book\n Roadmap\n About the code\n Other online resources\n About the author\n Author Online\nPart 1—Core concepts on the console\n 1 Programming, JavaScript, and JS Bin\n 1.1 Programming\n 1.2 JavaScript\n 1.3 Learning by doing and thinking\n 1.4 JS Bin\n 1.4.1 JS Bin panels\n 1.4.2 Following the code listings on JS Bin\n 1.4.3 Logging to the console\n 1.4.4 Code comments\n 1.4.5 Further Adventures\n 1.4.6 Error messages\n 1.4.7 Line numbers\n 1.4.8 Get an account\n 1.5 The Crypt—our running example\n 1.5.1 Playing The Crypt\n 1.5.2 Steps for building The Crypt\n 1.6 Further examples and practice\n 1.7 Browser support\n 1.8 Summary\n 2 Variables: storing data in your program\n 2.1 What is a variable?\n 2.2 Declaring variables and assigning values\n 2.2.1 Declaring variables\n 2.2.2 Assigning values to variables\n 2.2.3 One-step declaration and assignment\n 2.2.4 Using a variable in its own assignment\n 2.3 Choosing good variable names\n 2.3.1 Keywords and reserved words\n 2.3.2 Rules for naming variables\n 2.3.3 camelCase\n 2.3.4 Use descriptive variable names\n 2.4 The Crypt—player variables\n 2.5 Summary\n 3 Objects: grouping your data\n 3.1 A need for organization\n 3.2 Creating objects\n 3.2.1 Creating an empty object\n 3.2.2 Properties as key-value pairs\n 3.3 Accessing object properties\n 3.4 Updating object properties\n 3.5 Further examples\n 3.5.1 Writing a blog\n 3.5.2 Creating a calendar\n 3.5.3 What’s the weather like?\n 3.5.4 The testing effect\n 3.5.5 Create your own\n 3.6 The Crypt—a player object\n 3.7 Summary\n 4 Functions: code on demand\n 4.1 Noticing repetition\n 4.1.1 Displaying object properties as text\n 4.1.2 Adding tax and displaying a summary\n 4.2 Defining and calling functions\n 4.2.1 Defining new functions\n 4.2.2 Function expressions and function declarations\n 4.2.3 Using functions\n 4.2.4 Functions step by step\n 4.3 Reducing repetition\n 4.3.1 A function for displaying object properties as text\n 4.3.2 Functions for adding tax and displaying a summary\n 4.4 Making code easier to read and update\n 4.4.1 Updating the showMovieInfo function\n 4.5 The Crypt—displaying player information\n 4.5.1 A function to display player information\n 4.6 Summary\n 5 Arguments: passing data to functions\n 5.1 Function reuse and versatility\n 5.2 Passing information to functions\n 5.2.1 Passing one argument to a function\n 5.2.2 Passing multiple arguments to a function\n 5.3 The Crypt—displaying player information\n 5.3.1 Displaying players’ names\n 5.3.2 Displaying players’ health\n 5.3.3 Displaying players’ locations\n 5.3.4 Putting it all together—displaying players’ information\n 5.4 Summary\n 6 Return values: getting data from functions\n 6.1 Returning data from functions\n 6.1.1 The return value replaces the function call\n 6.1.2 The return keyword\n 6.1.3 Using arguments to determine the return value\n 6.2 Experimenting at the console prompt\n 6.2.1 Calling functions\n 6.2.2 Declaring new variables\n 6.3 The Crypt—building player information strings\n 6.3.1 Building strings for a player’s name, health, and location\n 6.3.2 A function for player information—putting the pieces together\n 6.4 Summary\n 7 Object arguments: functions working with objects\n 7.1 Using objects as arguments\n 7.1.1 Accessing properties of an object argument\n 7.1.2 Adding properties to an object argument\n 7.2 Returning objects from functions\n 7.2.1 Building planets—an object creation function\n 7.2.2 Points in 2D space\n 7.3 Methods—setting functions as properties of objects\n 7.3.1 Namespaces—organizing related functions\n 7.3.2 Math methods\n 7.3.3 String methods\n 7.3.4 spacer—more methods for your namespace\n 7.3.5 Deep namespace exploration\n 7.4 The Crypt–player objects as arguments\n 7.5 Summary\n 8 Arrays: putting data into lists\n 8.1 Creating arrays and accessing elements\n 8.1.1 Creating an array\n 8.1.2 Accessing array elements\n 8.2 Array methods\n 8.2.1 Adding and removing elements\n 8.2.2 Slicing and splicing arrays\n 8.2.3 Visiting each element with forEach\n 8.3 The Crypt—a player items array\n 8.4 Summary\n 9 Constructors: building objects with functions\n 9.1 Using functions to build objects\n 9.1.1 Adding properties\n 9.1.2 Adding methods\n 9.2 Using constructor functions to build objects\n 9.2.1 Constructor functions\n 9.2.2 World building—making use of the Planet constructor\n 9.2.3 Telling objects apart with the instanceof operator\n 9.3 Building mastery—two examples of constructors\n 9.4 The Crypt—providing places to plunder\n 9.4.1 Building the Place constructor—title and description\n 9.4.2 Building the Place constructor—items for your hoard\n 9.4.3 Building the Place constructor—exits to explore\n 9.5 The Crypt—streamlining player creation\n 9.5.1 Organizing player properties\n 9.5.2 Turning functions into methods\n 9.5.3 Assigning places to players\n 9.5.4 Using null as a placeholder for objects\n 9.6 Summary\n 10 Bracket notation: flexible property names\n 10.1 Using square brackets instead of dots\n 10.1.1 Brackets in action—people’s names as keys\n 10.1.2 Making the most of square bracket notation—word counts\n 10.2 The Crypt—enhancing exit excitement\n 10.2.1 Using an object to hold the exits\n 10.2.2 Creating functions to add and display exits\n 10.2.3 Giving each place object its own set of exits\n 10.2.4 Adding the exits object to the full Place constructor\n 10.2.5 Testing the Place constructor\n 10.3 The Crypt—let the games begin!\n 10.3.1 Updating the display—render\n 10.3.2 Exploring the map—go\n 10.3.3 Collecting all the things—get\n 10.3.4 Designing a bigger adventure—Jahver’s ship\n 10.4 What’s next?\n 10.5 Summary\nPart 2—Organizing your programs\n 11 Scope: hiding information\n 11.1 The dangers of global variables\n 11.1.1 Access all areas—peeking and tweaking\n 11.1.2 Access all areas—relying on an implementation\n 11.1.3 Naming collisions\n 11.1.4 Crazy bugs\n 11.2 The benefits of local variables\n 11.3 Interfaces—controlling access and providing functionality\n 11.3.1 Using a function to hide variables\n 11.3.2 Creating multiple independent counters with getCount\n 11.3.3 Creating multiple independent counters with a constructor function\n 11.4 Creating a quick quiz app\n 11.4.1 Using an object as a namespace\n 11.4.2 Hiding the questions array\n 11.5 The Crypt—hiding player info\n 11.5.1 Our current Player constructor—everything is public\n 11.5.2 An updated Player constructor—some variables are hidden\n 11.6 The Crypt—hiding place info\n 11.7 The Crypt—user interaction\n 11.7.1 The interface—go and get\n 11.7.2 Hiding the implementation\n 11.8 Summary\n 12 Conditions: choosing code to run\n 12.1 Conditional execution of code\n 12.1.1 The strict equality operator, ===\n 12.1.2 The if statement\n 12.1.3 The else clause\n 12.1.4 Hide the secret number inside a function\n 12.2 Generating random numbers with Math.random()\n 12.3 Further conditions with else if\n 12.3.1 Comparison operators\n 12.4 Checking answers in the quiz app\n 12.4.1 Multiple declarations with a single var keyword\n 12.4.2 Displaying a question\n 12.4.3 Moving to the next question\n 12.4.4 Checking the player’s answer\n 12.4.5 Handling a player’s answer\n 12.4.6 Returning the interface object\n 12.5 The Crypt—checking user input\n 12.5.1 Step by step through the go method\n 12.5.2 Never trust user input\n 12.5.3 Safe exploration—using the if statement to avoid problems\n 12.6 Summary\n 13 Modules: breaking a program into pieces\n 13.1 Understanding bins and files on JS Bin\n 13.1.1 Creating a bin\n 13.1.2 Writing some code\n 13.1.3 Making a note of the filename\n 13.1.4 Viewing an individual code file\n 13.2 Importing files into other projects\n 13.2.1 Creating a bin\n 13.2.2 Writing some code\n 13.2.3 Adding a script element\n 13.2.4 Refreshing the page\n 13.2.5 Running the program\n 13.3 Importing the Number Generator—further examples\n 13.3.1 Picking random questions in the quiz app\n 13.3.2 Using the between function in your guessing game\n 13.4 Importing multiple files\n 13.5 Collisions—when imported code overwrites your variables\n 13.5.1 Variable collisions\n 13.5.2 Minimizing collisions by using namespaces\n 13.6 Immediately invoked function expressions (IIFE)\n 13.6.1 Recognizing function expressions\n 13.6.2 Invoking functions\n 13.6.3 Immediately invoking function expressions\n 13.6.4 Returning information from an IIFE\n 13.7 The Crypt—organizing code into modules\n 13.7.1 Sharing a namespace across modules\n 13.8 Summary\n 14 Models: working with data\n 14.1 Building a fitness app—data and models\n 14.1.1 Defining a User constructor\n 14.1.2 Getting a feel for the data as a JavaScript object\n 14.1.3 Converting the data into a user model\n 14.1.4 What’s next for the fitness app?\n 14.2 The Crypt—separating map data from the game\n 14.2.1 Map data\n 14.2.2 Adding challenges to the map data\n 14.2.3 Updating the Place constructor to include challenges\n 14.2.4 Using the map data to build a game map\n 14.2.5 Bringing all the pieces together to run the game\n 14.3 Summary\n 15 Views: displaying data\n 15.1 Building a fitness app—displaying the latest user data\n 15.1.1 Creating your first fitness app view\n 15.1.2 Using modules to switch fitness app views\n 15.1.3 What’s next for the fitness app?\n 15.2 The Crypt—moving view code from Player and Place\n 15.2.1 Creating a view for players\n 15.2.2 Creating a view for places\n 15.3 Talking to players—a message view\n 15.4 Summary\n 16 Controllers: linking models and views\n 16.1 Building a fitness app—controllers\n 16.1.1 What does the controller do?\n 16.1.2 Building the fitness app controller\n 16.1.3 Putting the pieces together for a working fitness app\n 16.1.4 What’s next for the fitness app?\n 16.2 The Crypt—adding a game controller\n 16.2.1 What does the controller do?\n 16.2.2 Approaching the controller code\n 16.3 The Crypt—the structure of the controller code\n 16.4 The Crypt—starting and stopping the game\n 16.4.1 Initializing the game\n 16.4.2 Monitoring player health\n 16.4.3 Updating the display—functions that use the view modules\n 16.5 The Crypt—giving commands and solving puzzles\n 16.5.1 Picking up items with game.get\n 16.5.2 Listing the properties of a challenge\n 16.5.3 Moving with game.go\n 16.5.4 Licking the leopard with game.use\n 16.6 The Crypt—running the game\n 16.7 The Crypt—what’s next for the app?\n 16.8 Summary\nPart 3—JavaScript in the browser\n 17 HTML: building web pages\n 17.1 HTML, CSS, JavaScript—building a web page\n 17.1.1 Loading the layers\n 17.1.2 Loading the layers in JS Bin\n 17.2 HTML—a very short introduction\n 17.2.1 Starting with an empty page\n 17.2.2 Adding some content\n 17.2.3 Marking up a list\n 17.2.4 Some common HTML elements\n 17.3 Adding content to a web page with JavaScript\n 17.3.1 Getting an element by its id\n 17.3.2 Function declarations\n 17.3.3 What, no JavaScript?\n 17.4 Displaying data from an array\n 17.5 The Crypt—displaying players and places with web views\n 17.5.1 Updating the player and place view modules—the render method\n 17.5.2 Updating the player and place view modules—the listings\n 17.5.3 Using JavaScript’s strict mode\n 17.5.4 Loading modules and adding placeholders in the HTML\n 17.5.5 Adding a touch of CSS\n 17.5.6 Playing the game\n 17.5.7 Preparing the message view\n 17.6 Summary\n 18 Controls: getting user input\n 18.1 Working with buttons\n 18.1.1 Adding a button to a page\n 18.1.2 Writing functions to update the greeting\n 18.1.3 Listening for clicks\n 18.2 Using a select element to choose an option\n 18.2.1 Adding a select element to the page\n 18.2.2 A function to rate movies and a button to call it\n 18.3 Reading user input with text boxes\n 18.3.1 Adding a text box to the page\n 18.3.2 Adding an unordered list to display the comments\n 18.3.3 Getting references to the new elements\n 18.3.4 Updating the rateMovie function\n 18.3.5 Styling the examples with CSS\n 18.4 The Crypt—player commands via a text box\n 18.4.1 Adding controls to the page\n 18.4.2 Mapping text box entries to game commands\n 18.4.3 Issuing orders with split, join, pop, and shift\n 18.4.4 Deciding between options with switch\n 18.4.5 Making it so—listening for button clicks\n 18.4.6 Enter The Crypt\n 18.5 Summary\n 19 Templates: filling placeholders with data\n 19.1 Building a news page—breaking news\n 19.1.1 Comparing the news item data and HTML\n 19.1.2 Constructing the HTML by string concatenation\n 19.1.3 Designing with HTML templates\n 19.1.4 Using script tags for templates\n 19.2 Replacing one string with another\n 19.2.1 Chaining calls to replace\n 19.3 While loops—replacing a string multiple times\n 19.3.1 Repeating code while a condition is met\n 19.3.2 The while loop\n 19.3.3 Replacing a string while it can be found\n 19.3.4 Replacing strings with regular expressions\n 19.4 Automating placeholder replacement for templates\n 19.4.1 Matching template placeholders with object properties\n 19.4.2 Filling all of the placeholders for each key\n 19.4.3 Building a list of items using a template\n 19.5 Building a news page—news just in\n 19.5.1 Creating the templates and data modules\n 19.5.2 Importing the modules\n 19.6 The Crypt—improving the views\n 19.6.1 Creating HTML templates for all of the views\n 19.6.2 Updating the views to use the new templates\n 19.6.3 Enter The Crypt\n 19.7 Summary\n 20 XHR: loading data\n 20.1 Building a fitness app—retrieving user data\n 20.1.1 Locating the user data\n 20.1.2 Loading the user data—an outline\n 20.1.3 Loading the user data—the XMLHttpRequest constructor\n 20.1.4 Loading the user data—parsing the XHR response with JSON.parse\n 20.1.5 Loading JS Bin data—a handy function\n 20.1.6 Building the fitness app\n 20.1.7 The fitness app—what’s next?\n 20.2 JSON—a simple data format\n 20.2.1 Converting JSON into objects and arrays with JSON.parse\n 20.3 The Crypt—loading a map on demand\n 20.3.1 Specifying exits with JS Bin file codes\n 20.3.2 Using a cache—load each place only once\n 20.3.3 Replacing the Map Data and Map Builder modules with Map Manager\n 20.3.4 Updating the game controller to use the Map Manager\n 20.3.5 Building the game page\n 20.3.6 Enter The Crypt\n 20.4 Summary\n 21 Conclusion: get programming with JavaScript\n 21.1 Working locally with files\n 21.1.1 Writing code\n 21.1.2 Saving files\n 21.1.3 Opening your pages in a browser\n 21.1.4 Concatenating and minifying files\n 21.2 Getting help\n 21.3 What next?\n 21.3.1 The companion site\n 21.3.2 Books\n 21.3.3 Sites\n 21.3.4 Practice makes permanent\n 21.4 Summary\nindex\n Symbols\n A\n B\n C\n D\n E\n F\n G\n H\n I\n J\n K\n L\n M\n N\n O\n P\n R\n S\n T\n U\n V\n W\n X\n Y\nBack cover