Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'switch'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 2 results

  1. The Switch Conditional exercise on pages 143 - 150 makes us of an undefined variable, var cost; and I'm not sure what role it plays in the code. Do the cost elements in the switch statements load the value into the undefined variable var cost depending upon which condition is met in the document's type value? I can remove these two lines of code, as well as the undefined variable, var cost, and still see the membership form run: var type = document.getElementById('type'); var years = document.getElementById('years'); Why did we create a reference to the document element years when it seems not to be used in the script? Many mysteries have unfolded in this exercise.
  2. I've never seen this variation of the switch statement, could you guys please comment on it? switch ($language) { case 'German': echo 'Hallo, Welt!'; break; case 'Italian': echo 'Ciao, mondo!'; break; case 'Spanish': echo 'Hola, mundo!'; break; case 'English': default: echo 'Hello, world!'; break; } What surprised me is the last four lines: case 'English': default: echo 'Hello, world!'; break; I thought the default should be set without mentioning the case before. Is that a legitimate way of doing things or just a typo in the book?
×
×
  • Create New...