Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Odds & Ends

Odds & Ends

John Nunemaker

September 29, 2009
Tweet

More Decks by John Nunemaker

Other Decks in Programming

Transcript

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day = 24; var days_in_year = 365; var hours_in_year = hours_in_day * days_in_year; document.write(hours_in_year); </script> </body> </html> too much spacing Tuesday, September 29, 2009
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day = 24; var days_in_year = 365; var hours_in_year = hours_in_day * days_in_year; document.write(hours_in_year); </script> </body> </html> good Tuesday, September 29, 2009
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day = 24; var days_in_year = 365; var hours_in_year = hours_in_day * days_in_year; document.write(hours_in_year); </script> </body> </html> bad indention Tuesday, September 29, 2009
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day = 24; var days_in_year = 365; var hours_in_year = hours_in_day * days_in_year; document.write(hours_in_year); </script> </body> </html> good Tuesday, September 29, 2009
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day=24; var days_in_year=365; var hours_in_year=hours_in_day*days_in_year; document.write(hours_in_year); </script> </body> </html> no spacing around operators Tuesday, September 29, 2009
  6. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> var hours_in_day = 24; var days_in_year = 365; var hours_in_year = hours_in_day * days_in_year; document.write(hours_in_year); </script> </body> </html> good Tuesday, September 29, 2009
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) { if (i > 50) { document.write(i); } } </script> </body> </html> no indention Tuesday, September 29, 2009
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) { if (i > 50) { document.write(i); } } </script> </body> </html> no indention Tuesday, September 29, 2009
  9. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) { if (i > 50) { document.write(i); } } </script> </body> </html> good Tuesday, September 29, 2009
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) {if (i > 50) {document.write(i);}} </script> </body> </html> too much on one line Tuesday, September 29, 2009
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) { if (i > 50) {document.write(i);} } </script> </body> </html> too much on one line Tuesday, September 29, 2009
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"

    xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Example</title> </head> <body> <script type="text/javascript"> for (var i=0; i < 100; i++) { if (i > 50) { document.write(i); } } </script> </body> </html> good Tuesday, September 29, 2009
  13. var input = prompt('How old are you?'); returns a string

    of whatever the user enters Tuesday, September 29, 2009
  14. var input = prompt('How old are you?'); // when they

    click ok, input will be 27 Tuesday, September 29, 2009
  15. var input = prompt('How old are you?'); // same as

    below, accept input is from user rather than from a static variable you set var input = '27'; Tuesday, September 29, 2009
  16. alert('Here is an annoying message.'); pops up an annoying box

    people have to click ok on Tuesday, September 29, 2009
  17. var check = confirm('Are you sure?'); check would be true

    check would be false Tuesday, September 29, 2009