Skip to main content

Web Coding & Development All-in-One For Dummies

Paperback

$39.99

Web Coding & Development All-in-One For Dummies

Paul McFedries

ISBN: 978-1-119-47392-3 May 2018 848 Pages

Description

Speak the languages that power the web 

With more high-paying web development jobs opening every day, people with coding and web/app building skills are having no problems finding employment. If you’re a would-be developer looking to gain the know-how to build the interfaces, databases, and other features that run modern websites, web apps, and mobile apps, look no further. Web Coding & Development All-in-One For Dummies is your go-to interpreter for speaking the languages that handle those tasks.

Get started with a refresher on the rules of coding before diving into the languages that build interfaces, add interactivity to the web, or store and deliver data to sites. When you're ready, jump into guidance on how to put it all together to build a site or create an app.

  • Get the lowdown on coding basics
  • Review HTML and CSS
  • Make sense of JavaScript, jQuery, PHP, and MySQL
  • Create code for web and mobile apps

There’s a whole world of opportunity out there for developers—and this fast-track boot camp is here to help you acquire the skills you need to take your career to new heights!

Introduction 1

About This Book 2

Foolish Assumptions 3

Icons Used in This Book 4

Beyond the Book 4

Book 1: Getting Ready to Code for the Web 5

Chapter 1: How Web Coding and Development Work 7

The Nuts and Bolts of Web Coding and Development 8

Understanding the Front End: HTML and CSS 12

Understanding the Back End: PHP and MySQL 15

How It All Fits Together: JavaScript and jQuery 16

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

Setting Up the XAMPP for OS X Development Environment 29

Choosing Your Text Editor 33

Chapter 3: Finding and Setting Up a Web Host 35

Understanding Web Hosting Providers 36

A Buyer’s Guide to Web Hosting 37

Finding a Web Host 40

Finding Your Way around Your New Web Home 41

Book 2: Coding The Front End, Part 1: 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

Some Notes on Structure versus Style 57

Applying the Basic Text Tags 58

Creating Links 62

Building Bulleted and Numbered Lists 65

Inserting Special Characters 68

Inserting Images 69

Carving Up the Page 71

Chapter 2: Styling the Page with CSS 79

Figuring Out Cascading Style Sheets 80

Getting the Hang of CSS Rules and Declarations 81

Adding Styles to a Page 83

Styling Page Text 87

Working with Colors 93

Getting to Know the Web Page Family 95

Using CSS Selectors 96

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

Getting a Grip on Page Flow 113

Floating Elements 115

Positioning Elements 120

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

Shaping the Overall Page Layout with CSS Grid 153

Providing Fallbacks for Page Layouts 164

Book 3: Coding The Front End, Part 2: Javascript 167

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

Adding Comments to Your Code 180

Creating External JavaScript Files 181

Chapter 2: Understanding Variables 183

What Is a Variable? 184

Naming Variables: Rules and Best Practices 187

Understanding Literal Data Types 189

JavaScript Reserved Words 193

JavaScript Keywords 194

Chapter 3: Building Expressions 197

Understanding Expression Structure 197

Building Numeric Expressions 199

Building String Expressions 205

Building Comparison Expressions 208

Building Logical Expressions 215

Understanding Operator Precedence 219

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

Understanding Code Looping 234

Using while() Loops 235

Using for() Loops 237

Using do while() Loops 241

Controlling Loop Execution 243

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

Passing Values to Functions 255

Returning a Value from a Function 258

Understanding Local versus Global Variables 259

Using Recursive Functions 262

Chapter 6: Working with Objects 267

What Is an Object? 267

The JavaScript Object Hierarchy 269

Manipulating Object Properties 271

Working with Object Methods 273

Playing Around with the window Object 275

Programming the document Object 284

Chapter 7: Working with Arrays 291

What Is an Array? 291

Declaring an Array 293

Populating an Array with Data 294

Creating Multidimensional Arrays 299

Using the Array Object 300

Chapter 8: Manipulating Strings, Dates, and Numbers 311

Manipulating Text with the String Object 311

Dealing with Dates and Times 323

Working with Numbers: The Math Object 335

Chapter 9: Debugging Your Code 341

Understanding JavaScript’s Error Types 342

Getting to Know Your Debugging Tools 344

Debugging with the Console 345

Pausing Your Code 348

Stepping through Your Code 350

Monitoring Script Values 352

More Debugging Strategies 355

Top Ten Most Common JavaScript Errors 356

Top Ten Most Common JavaScript Error Messages 359

Book 4: Coding the Front End, Part 3: Jquery 363

Chapter 1: Developing Pages Faster with jQuery 365

Getting Started with jQuery 366

Selecting Elements with jQuery 369

Manipulating Page Elements with jQuery 373

Modifying CSS with jQuery 377

Tweaking HTML Attributes with jQuery 385

Chapter 2: Livening Up Your Page with Events and Animation 387

Building Reactive Pages with Events 388

Building Lively Pages with Animation 398

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

Introducing jQuery UI Effects 424

Taking a Look at jQuery UI Interactions 428

Book 5: Coding the Back End: Php and Mysql 433

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

Working with PHP Arrays 445

Controlling the Flow of Your PHP Code 451

Working with PHP Functions 456

Working with PHP Objects 458

Debugging PHP 463

Chapter 2: Building and Querying MySQL Databases 467

What Is MySQL? 468

Introducing phpMyAdmin 470

Creating a MySQL Database and Its Tables 473

Querying MySQL Data 480

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

Creating and Running Insert, Update, and Delete Queries 504

Separating Your MySQL Login Credentials 505

Book 6: Coding Dynamic Web Pages 507

Chapter 1: Melding PHP and JavaScript with Ajax and JSON 509

What Is Ajax? 510

Making Ajax Calls with jQuery 511

Introducing JSON 526

Returning Ajax Data as JSON Text 528

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

Handling and Triggering Form Events 557

Submitting the Form 561

Chapter 3: Validating Form Data 565

Validating Form Data in the Browser 566

Validating Form Data on the Server 574

Regular Expressions Reference 582

Book 7: Coding Web Apps 591

Chapter 1: Planning a Web App 593

What Is a Web App? 594

Planning Your Web App: The Basics 595

Planning Your Web App: Responsiveness 599

Planning Your Web App: Accessibility 605

Planning Your Web App: Security 608

Chapter 2: Laying the Foundation 619

Setting Up the Directory Structure 620

Creating the Database and Tables 624

Getting Some Back-End Code Ready 626

Creating the App Startup Files 630

Chapter 3: Managing Data 637

Handling Data the CRUD Way 638

Creating New Data 643

Reading and Displaying Data 652

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

Signing Up a New User 682

Signing a User In and Out 696

Resetting a Forgotten Password 704

Deleting a User 714

Book 8: Coding Mobile Web Apps 721

Chapter 1: Exploring Mobile-First Web Development 723

What Is Mobile-First Web Development? 724

Learning the Principles of Mobile-First Development 725

Going Mobile Faster with jQuery Mobile 729

Working with Images in a Mobile App 731

Storing User Data in the Browser 734

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

Building the App: CSS 754

Building the App: JavaScript and jQuery 757

Index 769