Showing posts with label Coding Books. Show all posts

8 Books in One!

by Paul McFedries

Contents at a Glance

Book 1: Getting Ready to Code for the Web
How Web Coding and Development Work
Setting Up Your Web Development Home
Finding and Setting Up a Web Host
Book 2: Coding the Front End, Part 1: HTML & CSS
Structuring the Page with HTML
Styling the Page with CSS 
Sizing and Positioning Page Elements 
Creating the Page Layout 
Book 3: Coding the Front End, Part 2: JavaScript
An Overview of JavaScript
Understanding Variables
Building Expressions
Controlling the Flow of JavaScript
Harnessing the Power of Functions
Working with Objects
Working with Arrays
Manipulating Strings, Dates, and Numbers
Debugging Your Code
Book 4: Coding the Front End, Part 3: jQuery
Developing Pages Faster with jQuery
Livening Up Your Page with Events and Animation
Getting to Know jQuery UI
Book 5: Coding the Back End: PHP and MySQL
Learning PHP Coding Basics
Building and Querying MySQL Databases
Using PHP to Access MySQL Data
Book 6: Coding Dynamic Web Pages
Melding PHP and JavaScript with Ajax and JSON
Building and Processing Web Forms
Validating Form Data
Book 7: Coding Web Apps
Planning a Web App
Laying the Foundation
Managing Data
Managing App Users.
Book 8: Coding Mobile Web Apps
Exploring Mobile-First Web Development
Building a Mobile Web App

e-books shop
e-books shop
Purchase Now !
Just with Paypal

Book Details
 843 p
 File Size 
 16,260 KB
 File Type
 PDF format
 978-1-119-47383-1 (ePDF)
 978-1-119-47379-4 (ePub)
 2018 by John Wiley & Sons, Inc 

When the web first came to the attention of the world’s non-geeks back in
the mid-1990s, the vastness and variety of its treasures were a wonder
to behold. However, it didn’t take long before a few courageous and
intrepid souls dug a little deeper into this phenomenon and discovered something
truly phenomenal: They could make web pages, too!

Why was that so amazing? Well, think back to those old days and think, in particular,
of what it meant to create what we now call content. Think about television
shows, radio programs, magazines, newspapers, books, and the other media
of the time. The one thing they all had in common was that their creation was a
decidedly uncommon thing. It required a team of professionals, a massive distribution
system, and a lot of money. In short, it wasn’t something that your average
Okie from Muskogee would have any hope of duplicating.

The web appeared to change all of that because learning HTML was within the
grasp of anybody who could feed himself, it had a built-in massive distribution
system (the Internet, natch), and it required little or no money. For the first time
in history, content was democratized and was no longer defined as the sole province
of governments and mega-corporations.

Then reality set in.
People soon realized that merely building a website wasn’t enough to attract
“eyeballs,” as the marketers say. A site had to have interesting, useful, or fun
content, or people would stay away in droves. Not only that, but this good content
had to be combined with a solid site design, which meant that web designers
needed a thorough knowledge of HTML and CSS.
But, alas, eventually even all of that was not enough. To make their websites
dynamic and interesting, to make their sites easy to navigate, and to give their
sites those extra bells and whistles that surfers had come to expect, something
more than content, HTML, and CSS was needed.
That missing link was code.
What we’ve all learned the hard way over the past few years is that you simply
can’t put together a world-class website unless you have some coding prowess
in your site design toolkit. You need to know how to program your way out of
the basic problems that afflict most sites; how to use scripting to go beyond the
inherent limitations of HTML and CSS; and how to use code to send and receive
data from a web server. And it isn’t enough just to copy the generic scripts that
are available on the web and paste them into your pages. First of all, most of those
scripts are very poorly written, and second of all, they invariably need some customization
to work properly on your site.

About This Book
My goal in this book is to give you a complete education on web coding and development.
You learn how to set up the tools you need, how to use HTML and CSS
to design and build your site, how to use JavaScript and jQuery to program your
pages, and how to use PHP and MySQL to program your web server. My aim is to
show you that these technologies aren’t hard to learn, and that even the greenest
rookie programmers can learn how to put together web pages that will amaze their
family and friends (and themselves).

If you’re looking for lots of programming history, computer science theory, and longwinded
explanations of concepts, I’m sorry but you won’t find it here. My philosophy
throughout this book comes from Linus Torvalds, the creator of the Linux operating
system: “Talk is cheap. Show me the code.” I explain what needs to be explained and
then I move on without further ado (or, most of the time, without any ado at all) to
examples and scripts that do more to illuminate a concept that any verbose explanations
I could muster (and believe me, I can muster verbosity with the best of them).

How you approach this book depends on your current level of web coding expertise
(or lack thereof):
»»If you’re just starting out, begin at the beginning with Book 1 and work at your
own pace sequentially through to Books 2 and 3. This will give you all the
knowledge you need to pick and choose what you want to learn throughout
the rest of the book.
»»If you know HTML and CSS, you can probably get away with taking a fast look
at Book 2, then settle in with Book 3 and beyond.
»»If you’ve done some JavaScript coding already, I suggest working quickly
through the material in Book 3, then dig into Book 4 a little slower if you don’t
already know jQuery. You’ll then be ready to branch out and explore the rest
of the book as you see fit.
»»If you’re a relatively experienced JavaScript programmer, use Books 3 and 4 as
a refresher, then tackle Book 5 to learn how to code the back end. I’ve got a
few tricks in there that you might find interesting. After that, feel free to
consider the rest of the book a kind of coding smorgasbord that you can
sample as your web development taste buds dictate.

Table of Contents
About This Book. 2
Foolish Assumptions. 3
“I’ve never coded before!”. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3
“I have coded before!”. 3
Icons Used in This Book. 4
Beyond the Book. 4
CHAPTER 1: How Web Coding and Development Work. 7
The Nuts and Bolts of Web Coding and Development . 8
How the web works. 8
How the web works, take two. 11
Understanding the Front End: HTML and CSS . 12
Adding structure: HTML. 13
Adding style: CSS. 14
Understanding the Back End: PHP and MySQL. 15
Storing data on the server: MySQL. 16
Accessing data on the server: PHP. 16
How It All Fits Together: JavaScript and jQuery. 16
Front end, meet back end: JavaScript. 16
Making your web coding life easier: jQuery . 17
How Dynamic Web Pages Work . 18
What Is a Web App?. 19
What Is a Mobile Web App?. 19
What’s the Difference between Web Coding
and Web Development?. 20
CHAPTER 2: Setting Up Your Web Development Home. 21
What Is a Local Web Development Environment?. 22
Do You Need a Local Web Development Environment?. 22
Setting Up the XAMPP for Windows Development Environment. 23
Installing XAMPP for Windows. 24
Running the XAMPP for Windows Control Panel . 26
Accessing your local web server. 27
Setting Up the XAMPP for OS X Development Environment. 29
Installing XAMPP for OS X. 29
Running the XAMPP Application Manager. 30
Accessing your local web server. 31
Choosing Your Text Editor. 33
CHAPTER 3: Finding and Setting Up a Web Host. 35
Understanding Web Hosting Providers. 36
Using your existing Internet provider. 36
Finding a free hosting provider. 37
Signing up with a commercial hosting provider. 37
A Buyer’s Guide to Web Hosting. 37
Finding a Web Host. 40
Finding Your Way around Your New Web Home. 41
Your directory and your web address . 42
Making your hard disk mirror your web home. 42
Uploading your site files. 44
Making changes to your web files. 45
HTML & CSS. 47
CHAPTER 1: Structuring the Page with HTML. 49
Getting the Hang of HTML. 50
Understanding Tag Attributes. 52
Learning the Fundamental Structure of an HTML5 Web Page. 53
Giving your page a title. 54
Adding some text. 56
Some Notes on Structure versus Style. 57
Applying the Basic Text Tags. 58
Emphasizing text. 58
Marking important text. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59
Nesting tags. 60
Adding headings . 60
Adding quotations. 61
Creating Links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62
Linking basics. 62
Anchors aweigh: Internal links. 63
Building Bulleted and Numbered Lists. 65
Making your point with bulleted lists. 65
Numbered lists: Easy as one, two, three. 67
Inserting Special Characters . 68
Inserting Images . 69
Carving Up the Page. 71
The <header> tag. 71
The <nav> tag. 72
The <main> tag . 73
The <article> tag . 74
The <section> tag . 74
The <aside> tag. 75
The <footer> tag . 75
Handling non-semantic content with <div>. 76
Handling words and characters with <span>. 77
CHAPTER 2: Styling the Page with CSS . 79
Figuring Out Cascading Style Sheets . 80
Styles: Bundles of formatting options . 80
Sheets: Collections of styles. 80
Cascading: How styles propagate. 81
Getting the Hang of CSS Rules and Declarations. 81
Adding Styles to a Page . 83
Inserting inline styles . 83
Embedding an internal style sheet. 84
Linking to an external style sheet. 86
Styling Page Text. 87
Setting the type size . 87
Getting comfy with CSS measurement units. 88
Applying a font family. 89
Making text bold . 91
Styling text with italics. 91
Styling links. 91
Aligning paragraph text . 92
Indenting a paragraph’s first line . 92
Working with Colors. 93
Specifying a color. 93
Coloring text. 94
Coloring the background. 94
Getting to Know the Web Page Family. 95
Using CSS Selectors. 96
The class selector . 97
The id selector. 98
The descendant selector . 99
The child selector. 99
Revisiting the Cascade . 100
CHAPTER 3: Sizing and Positioning Page Elements . 103
Learning about the CSS Box Model . 104
Styling Sizes . 105
Adding Padding. 107
Building Borders . 109
Making Margins. 110
Resetting the padding and margin. 111
Collapsing margins ahead!. 111
Getting a Grip on Page Flow . 113
Floating Elements . 115
Clearing your floats. 116
Collapsing containers ahead!. 117
Positioning Elements . 120
Using relative positioning. 121
Giving absolute positioning a whirl. 122
Trying out fixed positioning. 125
CHAPTER 4: Creating the Page Layout. 127
What Is Page Layout? . 128
Laying Out Page Elements with Floats. 128
Laying Out Page Elements with Inline Blocks. 132
Making Flexible Layouts with Flexbox . 136
Setting up the flex container. 137
Aligning flex items along the primary axis. 139
Aligning flex items along the secondary axis. 140
Centering an element horizontally and vertically. 141
Laying out a navigation bar with flexbox. 143
Allowing flex items to grow . 144
Allowing flex items to shrink. 146
Laying out content columns with flexbox . 149
Flexbox browser support. 152
Shaping the Overall Page Layout with CSS Grid. 153
Setting up the grid container. 154
Specifying the grid rows and columns. 154
Creating grid gaps. 155
Assigning grid items to rows and columns . 157
Aligning grid items. 160
Laying out content columns with Grid. 161
Grid browser support. 163
Providing Fallbacks for Page Layouts. 164
CHAPTER 1: An Overview of JavaScript . 169
JavaScript: Controlling the Machine. 170
What Is a Programming Language? . 171
Is JavaScript Hard to Learn?. 172
What Can You Do with JavaScript? . 173
What Can’t You Do with JavaScript? . 174
What Do You Need to Get Started?. 175
Basic Script Construction. 175
The <script> tag. 175
Handling browsers with JavaScript turned off. 176
Where do you put the <script> tag?. 176
Example #1: Displaying a message to the user. 177
Example #2: Writing text to the page. 179
Adding Comments to Your Code. 180
Creating External JavaScript Files . 181
CHAPTER 2: Understanding Variables. 183
What Is a Variable? . 184
Declaring a variable. 184
Storing a value in a variable. 185
Using variables in statements. 186
Naming Variables: Rules and Best Practices. 187
Rules for naming variables. 187
Ideas for good variable names . 188
Understanding Literal Data Types . 189
Working with numeric literals. 189
Working with string literals . 191
Working with Boolean literals. 193
JavaScript Reserved Words . 193
JavaScript Keywords . 194
CHAPTER 3: Building Expressions. 197
Understanding Expression Structure. 197
Building Numeric Expressions. 199
A quick look at the arithmetic operators. 199
Using the addition (+) operator. 200
Using the increment (++) operator. 200
Using the subtraction and negation (-) operators . 201
Using the decrement (--) operator . 202
Using the multiplication (*) operator. 202
Using the division (/) operator. 202
Using the modulus (%) operator. 204
Using the arithmetic assignment operators. 204
Building String Expressions. 205
Building Comparison Expressions . 208
The comparison operators. 208
Using the equal (==) operator. 208
Using the not equal (!=) operator . 209
Using the greater than (>) operator. 209
Using the less than (<) operator . 209
Using the greater than or equal (>=) operator. 210
Using the less than or equal (<=) operator . 210
The comparison operators and data conversion. 211
Using the identity (===) operator . 212
Using the non-identity (!==) operator. 212
Using strings in comparison expressions . 213
Using the ternary (?:) operator . 214
Building Logical Expressions. 215
The logical operators . 215
Using the AND (&&) operator . 215
Using the OR (||) operator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .216
Using the NOT (!) Operator . 217
Advanced notes on the && and || operators. 217
Understanding Operator Precedence . 219
The order of precedence. 220
Controlling the order of precedence . 221
CHAPTER 4: Controlling the Flow of JavaScript. 225
Understanding JavaScript’s Control Structures. 226
Making True/False Decisions with if() Statements . 226
Branching with if(). . .else Statements . 228
Making Multiple Decisions. 229
Using the AND (??) and OR (||) operators. 230
Nesting multiple if() statements . 230
Using the switch() statement. 231
Understanding Code Looping. 234
Using while() Loops. 235
Using for() Loops. 237
Using do. . .while() Loops. 241
Controlling Loop Execution. 243
Exiting a loop using the break statement . 243
Bypassing loop statements using the continue statement. 245
Avoiding Infinite Loops. 246
CHAPTER 5: Harnessing the Power of Functions. 249
What Is a Function?. 250
The Structure of a Function. 250
Where Do You Put a Function? . 251
Calling a Function . 252
Calling a function when the <script> tag is parsed. 252
Calling a function after the page is loaded . 253
Calling a function in response to an event . 254
Passing Values to Functions. 255
Passing a single value to a function. 256
Passing multiple values to a function. 257
Returning a Value from a Function. 258
Understanding Local versus Global Variables. 259
Working with local scope. 260
Working with global scope. 261
Using Recursive Functions. 262
CHAPTER 6: Working with Objects. 267
What Is an Object?. 267
The JavaScript Object Hierarchy . 269
Manipulating Object Properties . 271
Referencing a property. 271
Some objects are properties. 272
Changing the value of a property. 273
Working with Object Methods. 273
Playing Around with the window Object. 275
Referencing the window object. 275
Some window object properties you should know . 275
Working with JavaScript timeouts and intervals. 276
Interacting with the user . 280
Programming the document Object. 284
Specifying an element. 284
Working with elements. 287
CHAPTER 7: Working with Arrays. 291
What Is an Array?. 291
Declaring an Array. 293
Populating an Array with Data. 294
Declaring and populating an array at the same time. 295
Using a loop to populate an array. . . . . . . . . . . . . . . . . . . . . . . . . . .296
Using a loop to work with array data. 297
Creating Multidimensional Arrays . 299
Using the Array Object. 300
The length property . 300
Concatenating to create a new array: concat(). 301
Creating a string from an array’s elements: join(). . . . . . . . . . . . . .302
Removing an array’s last element: pop(). 303
Adding elements to the end of an array: push(). 303
Reversing the order of an array’s elements: reverse(). 304
Removing an array’s first element: shift() . 305
Returning a subset of an array: slice() . 305
Ordering array elements: sort(). 306
Removing, replacing, and inserting elements: splice(). 308
Inserting elements at the beginning of an array: unshift(). 310
CHAPTER 8: Manipulating Strings, Dates, and Numbers . 311
Manipulating Text with the String Object . 311
Determining the length of a string. 312
Finding substrings. 313
Methods that extract substrings. 315
Dealing with Dates and Times. 323
Arguments used with the Date object. 324
Working with the Date object . 324
Extracting information about a date. . . . . . . . . . . . . . . . . . . . . . . . .325
Setting the date. 330
Performing date calculations. 332
Working with Numbers: The Math Object. 335
Converting between strings and numbers . 336
The Math object’s properties and methods. . . . . . . . . . . . . . . . . . .338
CHAPTER 9: Debugging Your Code. 341
Understanding JavaScript’s Error Types. 342
Syntax errors. 342
Runtime errors. 342
Logic errors. 343
Getting to Know Your Debugging Tools. 344
Debugging with the Console. 345
Displaying the console in various browsers . 346
Logging data to the Console . 346
Executing code in the Console. 347
Pausing Your Code . 348
Entering break mode . 348
Exiting break mode. 350
Stepping through Your Code. 350
Stepping into some code. 351
Stepping over some code. 351
Stepping out of some code . 352
Monitoring Script Values . 352
Viewing a single variable value . 352
Viewing all variable values. 353
Adding a watch expression . 354
More Debugging Strategies. 355
Top Ten Most Common JavaScript Errors. 356
Top Ten Most Common JavaScript Error Messages. 359
CHAPTER 1: Developing Pages Faster with jQuery. 365
Getting Started with jQuery. 366
How to include jQuery in your web page. 366
Understanding the $ function. 368
Where to put jQuery code. 368
Selecting Elements with jQuery. 369
Using the basic selectors . 370
Working with jQuery sets. 371
Manipulating Page Elements with jQuery. 373
Adding an element . 374
Replacing an element’s HTML. 375
Replacing an element’s text. 376
Removing an element. 377
Modifying CSS with jQuery. 377
Working with CSS properties. 378
Manipulating classes. 382
Tweaking HTML Attributes with jQuery. 385
Reading an attribute value. 385
Setting an attribute value. 385
Removing an attribute . 386
CHAPTER 2: Livening Up Your Page with Events
and Animation. 387
Building Reactive Pages with Events. 388
What’s an event?. 388
Understanding the event types. 389
Setting up an event handler. 390
Using jQuery’s shortcut event handlers. 391
Getting data about the event. 393
Preventing the default event action. 394
Getting your head around event delegation. 396
Turning off an event handler. 398
Building Lively Pages with Animation. 398
Hiding and showing elements. 399
Fading elements out and in. 400
Sliding elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .401
Controlling the animation duration and pace. 402
Example: Creating a web page accordion. 403
Animating CSS properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .406
Running code when an animation ends. . . . . . . . . . . . . . . . . . . . . .408
CHAPTER 3: Getting to Know jQuery UI. 411
What’s the Deal with jQuery UI? . 412
Getting Started with jQuery UI . 413
Working with the jQuery UI Widgets. 415
Dividing content into tabs . 415
Creating a navigation menu. 418
Displaying a message in a dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . .420
Hiding and showing content with an accordion. 422
Introducing jQuery UI Effects. 424
Applying an effect. 424
Checking out the effects. 426
Taking a Look at jQuery UI Interactions. 428
Applying an interaction. 428
Trying out the interactions. 429
CHAPTER 1: Learning PHP Coding Basics. 435
Understanding How PHP Scripts Work . 436
Learning the Basic Syntax of PHP Scripts . 436
Declaring PHP Variables. 438
Building PHP Expressions. 438
Outputting Text and Tags. 439
Adding line breaks. 440
Mixing and escaping quotation marks. 441
Outputting variables in strings . 442
Outputting long strings. 443
Outputting really long strings . 444
Working with PHP Arrays. 445
Declaring arrays. 445
Giving associative arrays a look. 446
Outputting array values. 447
Sorting arrays. 448
Looping through array values. 450
Creating multidimensional arrays. 450
Controlling the Flow of Your PHP Code. 451
Making decisions with if(). 452
Making decisions with switch() . 453
Looping with while() . 454
Looping with for() . 455
Looping with do. . .while(). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .456
Working with PHP Functions. 456
Passing values to functions. 457
Returning a value from a function . 458
Working with PHP Objects. 458
Rolling your own objects . 458
Creating an object. 461
Working with object properties. 461
Working with object methods. 462
Debugging PHP. 463
Configuring php.ini for debugging. 463
Accessing the PHP error log. 464
Debugging with echo statements. 465
Debugging with var_dump() statements . 466
CHAPTER 2: Building and Querying MySQL Databases. 467
What Is MySQL?. 468
Tables: Containers for your data. 468
Queries: Asking questions of your data. 469
Introducing phpMyAdmin . 470
Importing data into MySQL. 471
Backing up MySQL data. 473
Creating a MySQL Database and Its Tables. 473
Creating a MySQL database. 473
Designing your table. 474
Creating a MySQL table . 477
Adding data to a table. 479
Creating a primary key. 479
Querying MySQL Data. 480
What Is SQL?. 480
Creating a SELECT query. 481
Understanding query criteria . 482
Querying multiple tables . 485
Adding table data with an INSERT query. 490
Modifying table data with an UPDATE query. . . . . . . . . . . . . . . . . .491
Removing table data with a DELETE query . 492
CHAPTER 3: Using PHP to Access MySQL Data. 493
Understanding the Role of PHP and MySQL in Your Web App. 494
Using PHP to Access MySQL Data. 495
Parsing the query string. 495
Connecting to the MySQL database. 497
Creating and running the SELECT query . 499
Storing the query results in an array . 500
Looping through the query results. 501
Incorporating query string values in the query. 501
Creating and Running Insert, Update, and Delete Queries. 504
Separating Your MySQL Login Credentials . 505
CHAPTER 1: Melding PHP and JavaScript with
Ajax and JSON. 509
What Is Ajax? . 510
Making Ajax Calls with jQuery. 511
Learning more about GET and POST requests. 511
Handling POST requests in PHP . 513
Using .load() to update an element with server data. 514
Using .get() or .post() to communicate with the server. 523
Introducing JSON. 526
Learning the JSON syntax. 526
Declaring and using JSON variables. 527
Returning Ajax Data as JSON Text. 528
Converting server data to the JSON format. 528
Handling JSON data returned by the server . 530
CHAPTER 2: Building and Processing Web Forms. 533
What Is a Web Form? . 534
Understanding How Web Forms Work. 535
Building an HTML5 Web Form. 536
Setting up the form. 536
Adding a form button. 537
Working with text fields . 538
Coding checkboxes. 543
Working with radio buttons. 548
Adding selection lists . 551
Programming pickers. 555
Handling and Triggering Form Events . 557
Setting the focus . 558
Monitoring the focus event. 559
Blurring an element . 559
Monitoring the blur event . 560
Listening for element changes . 560
Submitting the Form. 561
Triggering the submit event. 562
Preventing the default form submission. 562
Preparing the data for submission. 563
Submitting the form data. 563
CHAPTER 3: Validating Form Data. 565
Validating Form Data in the Browser. 566
Making a form field mandatory. 566
Restricting the length of a text field. 567
Setting maximum and minimum values on a numeric field. 568
Validating email fields. 569
Making field values conform to a pattern. 570
Styling invalid fields. 571
Validating Form Data on the Server. 574
Checking for required fields. 575
Validating text data. 578
Validating a field based on the data type. 580
Validating against a pattern. 582
Regular Expressions Reference. 582
CHAPTER 1: Planning a Web App. 593
What Is a Web App?. 594
Planning Your Web App: The Basics. 595
What is my app’s functionality?. 595
What are my app’s data requirements?. 596
How will my app work?. 597
How many pages will my app require?. . . . . . . . . . . . . . . . . . . . . . .597
What will my app’s pages look like? . 598
Planning Your Web App: Responsiveness. 599
Planning Your Web App: Accessibility. 605
Planning Your Web App: Security. 608
Understanding the dangers. 609
Defending your web app. 612
CHAPTER 2: Laying the Foundation. 619
Setting Up the Directory Structure. 620
Setting up the public subdirectory. 621
Setting up the private subdirectory . 623
Creating the Database and Tables. 624
Getting Some Back-End Code Ready . 626
Defining PHP constants . 626
Understanding PHP sessions. 627
Securing a PHP session. 628
Including code from another PHP file . 629
Creating the App Startup Files. 630
Creating the back-end initialization file. 631
Creating the front-end common files. 633
Building the app home page. 635
CHAPTER 3: Managing Data. 637
Handling Data the CRUD Way. 638
Starting the web app’s data class . 639
Creating a data handler script. 640
Creating New Data . 643
Building the form. 643
Sending the form data to the server . 648
Adding the data item. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .649
Reading and Displaying Data. 652
Getting the home page ready for data. 652
Making an Ajax request for the data . 654
Reading the data. 655
Displaying the data. 656
Filtering the data. 657
Updating and Editing Data. 661
Deleting Data. 668
CHAPTER 4: Managing App Users. 673
Configuring the Home Page. 674
Setting Up the Back End to Handle Users. 677
Starting the web app’s user class . 678
Creating a user handler script. 679
Signing Up a New User. 682
Building the form. 683
Sending the data to the server . 685
Sending a verification email. 688
Adding the user to the database. 689
Verifying the user . 690
Signing a User In and Out. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .696
Checking for a signed-in user . 696
Adding the form. 697
Checking the user’s credentials. 700
Signing out a user. 704
Resetting a Forgotten Password. 704
Deleting a User . 714
CHAPTER 1: Exploring Mobile-First Web Development. . . . . . . . . .723
What Is Mobile-First Web Development?. 724
Learning the Principles of Mobile-First Development. 725
Mobile first means content first . 725
Pick a testing width that makes sense for your site. 726
Get your content to scale with the device. 726
Build your CSS the mobile-first way. 727
Pick a “non-mobile” breakpoint that makes sense
for your content. 727
Going Mobile Faster with jQuery Mobile. 729
What is jQuery Mobile?. 729
Adding jQuery Mobile to your web app. 730
Working with Images in a Mobile App. 731
Making images responsive. 731
Delivering images responsively. 732
Storing User Data in the Browser. 734
Understanding web storage . 735
Adding data to storage. 735
Getting data from web storage. 736
Removing data from web storage. 737
CHAPTER 2: Building a Mobile Web App. 739
Building the Button Builder App. 740
Getting Some Help from the Web. 741
Building the App: HTML. 741
Setting up the home page skeleton. 741
Configuring the header. 744
Creating the app menu. 745
Adding the app’s controls. 745
Building the App: CSS. 754
Building the App: JavaScript and jQuery . 757
Setting up the app data structures. 757
Setting the app’s control values . 758
Getting the app’s control values. 761
Writing the custom CSS code. 763
Running the code. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .765
Saving the custom CSS. 765
Copying the custom CSS. 766
Resetting the CSS to the default. 767
INDEX . 769

e-books shop

Foolish Assumptions
This book is not a primer on the Internet or on using the World Wide Web. This is a
coding and development book, pure and simple. This means I assume the following:
»»You know how to operate a basic text editor, and how to get around the
operating system and file system on your computer.
»»You have an Internet connection.
»»You know how to use your web browser.
Yep, that’s it.

“I’ve never coded before!”
If you’ve never done a stitch of computer programming before, even if you’re not
quite sure what programming really is, don’t worry about it for a second because
I had you in mind when I wrote this book. For too many years programming has
been the property of “hackers” and other technowizards. That made some sense
because the programming languages they were using — with bizarre names such
as C++ and Perl — were exceedingly difficult to learn, and even harder to master.
This book’s main coding technologies — HTML, CSS, JavaScript, jQuery, PHP, and
MySQL — are different. They’re nowhere near as hard to learn as those for-nerdsonly
languages. I honestly believe that anyone can become a savvy and successful
web coder, and this book is, I hope, the proof of that assertion. Just follow along,
examine my code carefully (particularly in the first few chapters), and practice
what you learn, and you will master web coding and development.

“I have coded before!”
What if you’ve done some programming in the past? For example, you might have
dipped a toe or two in the JavaScript waters already, or you might have dabbled
with HTML and CSS. Will this book be too basic for you? No, not at all. My other
main goal in this book is to provide you with a ton of truly useful examples that
you can customize and incorporate into your own site. The book’s first few chapters
start slowly to avoid scaring off those new to this programming business. But
once you get past the basics, I introduce you to lots of great techniques and tricks
that will take your web coding skills to a higher level.

by Nikhil Abraham, Andrie de Vries, Andy Harris, Eva Holland, Luca Massaron, Chris Minnick, Joris Meys, John Mueller

e-books shop
e-books shop
Purchase Now !
Just with Paypal

Book Details
 4.00 USD
 834 p
 File Size
 17,808 KB
 File Type
 PDF format
 978-1-119-36302-6 (pbk)
 978-1-119-36303-3 (epub)
 978-1-119-36305-7 (epdf)
 2017 by John Wiley & Sons, Inc 

About the Author
Nikhil Abraham is currently the CFO of Udacity, a venture-backed
education technology startup that teaches its students how to code and that
bridges the gap between real-world skills, relevant education, and
employment. Prior to joining Udacity, he worked at Codecademy. At
Codecademy, he helped technology, finance, media, and advertising
companies teach their employees how to code. With his help, thousands of
marketing, sales, and recruiting professionals have written their first lines of
code and built functional applications. In addition to his day job, he has
lectured at the University of Chicago Law School and created a course that
teaches students how to solve legal problems using open data and software.
Prior to joining startups, Nikhil worked in a variety of fields, including
management consulting, investment banking, and law; he also founded a Y
Combinator-backed technology education startup. He received a JD and
MBA from the University of Chicago and a BA in quantitative economics
from Tufts University.
Nikhil is a recent transplant from Manhattan, New York, and now lives in
Mountain View, California. Content from Nikhil's books Coding For
Dummies and Getting a Coding Job For Dummies appears in this book.

Andrie de Vries started to use R in 2009 to analyze survey data, and he has
been continually impressed by the ability of the open-source community to
innovate and create phenomenal software. During 2009 he also started
PentaLibra, a boutique market research and statistical analysis agency. After
getting increasingly involved in the R community, he joined Revolution
Analytics to help take R to enterprise customers, helping clients to deal with
the challenges of data science and big data. To maintain equilibrium in his
life, Andrie is studying and practicing yoga. Content from Andrie's book R
For Dummies, 2nd Edition appears in this book.

Andy Harris began his teaching life as a special education teacher. He joined
the faculty of the Indiana University-Purdue University Indianapolis
Computer Science department in 1995. He serves as a Senior Lecturer,
teaching the introductory course to freshmen as well as numerous courses on
web development, general programming, and game programming. As
manager of the Streaming Media Laboratory, he developed a number of
online video-based courses, and worked on a number of international distance
education projects including helping to start a computer science program in
Tetevo, Macedonia FYR, and collaboration with Sun-Yat-Sen University in
Guangzhou, China.
Andy is active in home schooling, and is the technology columnist for a
national homeschool magazine.

Eva Holland is an experienced writer, trainer, and cofounder of WatzThis?.
She excels in presenting complicated subjects in easy-to-understand language
for beginners of all levels.
Eva has written, designed, and taught online, in-person, and video courses.
She has created curriculum for web development, mobile web development,
and search engine optimization (SEO). Prior to founding WatzThis?, Eva
served as COO of MWS, where she provided astute leadership, management,
and vision that guided the company to its goals. Content from Eva's book
Coding with JavaScript For Dummies appears in this book.

Luca Massaron is a data scientist and marketing research director who
specializes in multivariate statistical analysis, machine learning, and customer
insight, with more than a decade of experience in solving real-world
problems and generating value for stakeholders by applying reasoning,
statistics, data mining, and algorithms. From being a pioneer of web audience
analysis in Italy to achieving the rank of top ten Kaggler on, he
has always been passionate about everything regarding data and analysis and
about demonstrating the potentiality of data-driven knowledge discovery to
both experts and nonexperts. Content from Luca's books Machine Learning
For Dummies and Python for Data Science For Dummies appears in this book.

Chris Minnick is an accomplished author, trainer, and web developer. Prior
to cofounding WatzThis?, Chris was CEO of Minnick Web Services for 18
years, where he managed and worked on hundreds of web and mobile
projects for customers ranging from small businesses to some of the world’s
largest companies. Content from Chris' book Coding with JavaScript For
Dummies appears in this book.

Joris Meys, MSc is a statistical consultant, R programmer and R lecturer at
Ghent University (Belgium). After earning a master’s degree in biology, he
worked for six years in environmental research and management before
starting an advanced master’s degree in statistical data analysis. Joris writes
packages for both specific projects and general implementation of methods
developed in his department, and he is the maintainer of several packages on
R-Forge. He has co-authored a number of scientific papers as a statistical
expert. To balance science with culture, Joris spends most of his spare time
playing saxophone in a couple of local bands. Content from Joris' book R For
Dummies, 2nd Edition appears in this book.

John Mueller is a freelance author and technical editor. He has writing in his
blood, having produced 100 books and more than 600 articles to date. His
technical editing skills have helped more than 63 authors refine the content of
their manuscripts. John has provided technical editing services to both Data
Based Advisor and Coast Compute magazines. It was during his time with
Data Based Advisor that John was first exposed to MATLAB, and he has
continued to follow the progress in MATLAB development ever since.
During his time at Cubic Corporation, John was exposed to reliability
engineering and has continued his interest in probability. Be sure to read
John’s blog at Content from John's
books Machine Learning For Dummies and Python for Data Science For
Dummies appears in this book.

The ability to read, write, and understand code has never been more
important, useful, or lucrative than it is today. Computer code has forever
changed our lives. Many people can’t even make it through the day without
interacting with something built with code. Even so, for many people, the
world of coding seems complex and inaccessible. Maybe you participated in
a tech-related business meeting and did not fully understand the conversation.
Perhaps you tried to build a web page for your family and friends, but ran
into problems displaying pictures or aligning text. Maybe you’re even
intimidated by the unrecognizable words on the covers of books about
coding, words such as HTML, CSS, JavaScript, Python, or Ruby.

If you’ve previously been in these situations, 
This book explains basic concepts so you can participate
in technical conversations and ask the right questions, and it goes even further
than Coding For Dummies by covering additional topics in data science,
machine learning, and coding careers. Don’t worry — this book assumes
you’re starting with little to no previous coding knowledge, and I haven’t
tried to cram every possible coding concept into these pages. Additionally, I
encourage you here to learn by doing and by actually creating your own
programs. Instead of a website, imagine that you want to build a house. You
could spend eight years studying to be an architect, or you could start today
by learning a little bit about foundations and framing. This book kick-starts
your coding journey today.

The importance of coding is ever-increasing. As author and technologist
Douglas Rushkoff famously said, “program or be programmed.” When
humans invented languages and then the alphabet, people learned to listen
and speak, and then read and write. In our increasingly digital world, it’s
important to learn not just how to use programs but also how to make them.
For example, observe this transition in music. For over a century, music
labels decided what songs the public could listen to and purchase. In 2005,
three coders created YouTube, which allowed anyone to release songs. Today
more songs have been uploaded to YouTube than have been released by all
the record labels combined in the past century.

Accompanying this book are examples at, whose
exercises are one of the easiest ways to learn how to code without installing
or downloading anything. The Codecademy website includes examples and
exercises from this book, along with projects and examples for additional practice.

Table of Contents
About This Book
Foolish Assumptions
Icons Used in This Book
Beyond the Book
Where to Go from Here
Book 1: Getting Started with Coding
Chapter 1: What Is Coding?
Defining What Code Is
Understanding What Coding Can Do for You
Surveying the Types of Programming Languages
Taking a Tour of a Web App Built with Code
Chapter 2: Programming for the Web
Displaying Web Pages on Your Desktop and Mobile Device
Coding Web Applications
Coding Mobile Applications
Chapter 3: Becoming a Programmer
Writing Code Using a Process
Picking Tools for the Job
Book 2: Career Building with Coding
Chapter 1: Exploring Coding Career Paths
Augmenting Your Existing Job
Finding a New Coding Job
Chapter 2: Exploring Undergraduate and Graduate Degrees
Getting a College Degree
Enrolling in an Advanced Degree Program
Interning to Build Credibility
Chapter 3: Training on the Job
Taking a Work Project to the Next Level
Learning on the Job and after Work
Freelancing to Build Confidence and Skills
Transitioning to a New Role
Chapter 4: Coding Career Myths
Educational Myths
Career Myths
Book 3: Basic Web Coding
Chapter 1: Exploring Basic HTML
What Does HTML Do?
Understanding HTML Structure
Getting Familiar with Common HTML Tasks and Tags
Styling Me Pretty
Building Your First Website Using HTML
Chapter 2: Getting More Out of HTML
Organizing Content on the Page
Listing Data
Putting Data in Tables
Filling Out Forms
Practicing More with HTML
Chapter 3: Getting Stylish with CSS
What Does CSS Do?
CSS Structure
Common CSS Tasks and Selectors
Styling Me Pretty
Chapter 4: Next Steps with CSS
Styling (More) Elements on Your Page
Selecting Elements to Style
Aligning and Laying Out Your Elements
Writing More Advanced CSS
Chapter 5: Building Floating Page Layouts
Creating a Basic Two-Column Design
Building a Three-Column Design
Building a Fixed-Width Layout
Building a Centered Fixed-Width Layout
Chapter 6: Using Alternative Positioning
Working with Absolute Positioning
Managing z-index
Building a Page Layout with Absolute Positioning
Creating a More Flexible Layout
Exploring Other Types of Positioning
Flexible Box Layout Model
Book 4: Advanced Web Coding
Chapter 1: Working Faster with Twitter Bootstrap
Figuring Out What Bootstrap Does
Installing Bootstrap
Understanding the Layout Options
Coding Basic Web Page Elements
Build the Airbnb Home Page
Chapter 2: Adding in JavaScript
What Does JavaScript Do?
Understanding JavaScript Structure
Coding Common JavaScript Tasks
Writing Your First JavaScript Program
Working with APIs
Using JavaScript Libraries
Chapter 3: Understanding Callbacks and Closures
What Are Callbacks?
Understanding Closures
Using Closures
Chapter 4: Embracing AJAX and JSON
Working behind the Scenes with AJAX
Putting Objects in Motion with JSON
Chapter 5: jQuery
Writing More and Doing Less
Getting Started with jQuery
The jQuery Object
Is Your Document Ready?
Using jQuery Selectors
Changing Things with jQuery
Book 5: Creating Web Applications
Chapter 1: Building Your Own App
Building a Location-Based Offer App
Following an App Development Process
Planning Your First Web Application
Exploring the Overall Process
Meeting the People Who Bring a Web App to Life
Chapter 2: Researching Your First Web
Dividing the App into Steps
Identifying Research Sources
Researching the Steps in the McDuck’s Offer App
Choosing a Solution for Each Step
Chapter 3: Coding and Debugging Your First Web
Getting Ready to Code
Coding Your First Web Application
Debugging Your App
Book 6: Selecting Data Analysis Tools
Chapter 1: Wrapping Your Head around Python
What Does Python Do?
Defining Python Structure
Coding Common Python Tasks and Commands
Shaping Your Strings
Building a Simple Tip Calculator Using Python
Chapter 2: Installing a Python Distribution
Choosing a Python Distribution with Machine Learning in Mind
Installing Python on Linux
Installing Python on Mac OS X
Installing Python on Windows
Downloading the Data Sets and Example Code
Chapter 3: Working with Real Data
Uploading, Streaming, and Sampling Data
Accessing Data in Structured Flat-File Form
Sending Data in Unstructured File Form
Managing Data from Relational Databases
Interacting with Data from NoSQL Databases
Accessing Data from the Web
Book 7: Evaluating Data
Chapter 1: Conditioning Your Data
Juggling between NumPy and pandas
Validating Your Data
Manipulating Categorical Variables
Dealing with Dates in Your Data
Dealing with Missing Data
Slicing and Dicing: Filtering and Selecting Data
Concatenating and Transforming
Aggregating Data at Any Level
Chapter 2: Shaping Data
Working with HTML Pages
Working with Raw Text
Using the Bag of Words Model and Beyond
Working with Graph Data
Chapter 3: Getting a Crash Course in MatPlotLib
Starting with a Graph
Setting the Axis, Ticks, Grids
Defining the Line Appearance
Using Labels, Annotations, and Legends
Chapter 4: Visualizing the Data
Choosing the Right Graph
Creating Advanced Scatterplots
Plotting Time Series
Plotting Geographical Data
Visualizing Graphs
Chapter 5: Exploring Data Analysis
The EDA Approach
Defining Descriptive Statistics for Numeric Data
Counting for Categorical Data
Creating Applied Visualization for EDA
Understanding Correlation
Modifying Data Distributions
Chapter 6: Exploring Four Simple and Effective
Guessing the Number: Linear Regression
Moving to Logistic Regression
Making Things as Simple as Naïve Bayes
Learning Lazily with Nearest Neighbors
Book 8: Essentials of Machine Learning
Chapter 1: Introducing How Machines Learn
Getting the Real Story about AI
Learning in the Age of Big Data
Chapter 2: Demystifying the Math behind Machine
Working with Data
Exploring the World of Probabilities
Describing the Use of Statistics
Chapter 3: Descending the Right Curve
Interpreting Learning as Optimization
Exploring Cost Functions
Descending the Error Curve
Updating by Mini-Batch and Online
Chapter 4: Validating Machine Learning
Checking Out-of-Sample Errors
Getting to Know the Limits of Bias
Keeping Model Complexity in Mind
Keeping Solutions Balanced
Training, Validating, and Testing
Resorting to Cross-Validation
Looking for Alternatives in Validation
Optimizing Cross-Validation Choices
Avoiding Sample Bias and Leakage Traps
Book 9: Applying Machine Learning
Chapter 1: Starting with Simple Learners
Discovering the Incredible Perceptron
Growing Greedy Classification Trees
Taking a Probabilistic Turn
Chapter 2: Leveraging Similarity
Measuring Similarity between Vectors
Using Distances to Locate Clusters
Tuning the K-Means Algorithm
Searching for Classification by k-Nearest Neighbors
Leveraging the Correct K Parameter
Chapter 3: Hitting Complexity with Neural
Learning and Imitating from Nature
Struggling with Overfitting
Introducing Deep Learning
Chapter 4: Resorting to Ensembles of Learners
Leveraging Decision Trees
Working with Almost Random Guesses
Boosting Smart Predictors
Averaging Different Predictors
Chapter 5: Real-World Applications
Classifying Images
Scoring Opinions and Sentiments
Using Scoring and Classification
Recommending Products and Movies
About the Authors
Advertisement Page
Connect with Dummies
End User License Agreement

e-books shop

About This Book
This book is designed for readers with little to no coding experience, and
gives an overview of programming to non-programmers. In plain English,
you learn how code is used to create web programs, who makes those
programs, and the processes they use. The topics covered include
Explaining what coding is and answering the common questions related
to code Building basic websites using the three most common languages: 
HTML, CSS, and JavaScript
Surveying other programming languages such as Python
Creating an application using HTML, CSS, and JavaScript
Analyzing data using machine learning algorithms and techniques
Exploring coding careers paths and different ways to learn how to code
As you read this book, keep the following in mind:
The book can be read from beginning to end, but feel free to skip around
if you like. If a topic interests you, start there. You can always return to
the previous chapters, if necessary.

At some point, you will get stuck, and the code you write will not work as
intended. Do not fear! There are many resources to help you, including
support forums, others on the Internet, and me! Using Twitter, you can
send me a public message at @nikhilgabraham with the hashtag
#codingFD. Additionally, you can sign up for book updates and
explanations for changes to programming language commands by visiting

Code in the book will appear in a monospaced font like this: 
<h1>Hi there!</h1>.
Loading... Protection Status