"Spot the Error" Competition 2: Olympic Edition

Spot the Error!
[rule=“100%”]Orange[/rule]

Here is the second Spot the Error Competition. (If you missed the first, you can find it [COLOR=“#FF8C00”]here[/COLOR].)

See how many errors you can find in the quoted text below—a pretend forum post. These include grammatical and coding errors, and perhaps even others.

Since we’re in Olympic mode, we’ll award a free SitePoint ebook to the best three responses—ranked in Gold, Silver and Bronze positions.

Here are some ways to stand out from the crowd:

  • spot more errors than anyone else
  • offer outstanding explanations for why something is an error
  • list errors neatly, in point form.

Beware, though, as there’s a sting in the tail this time. If you flag something as an error that’s not one, you’ll be disqualified, so choose your errors carefully!

Remember that this is just for fun, and lively debate is welcome! We’ll leave the actual competition open for a day or two.

Good luck!

There seems to be problems with this code, but I can not see what. Id be greatful to whomever is able help with this. Im not much good with java.

<DOCTYPE html>
<html lang="em">
<head>

<meta charset="utf8">

<title>Spot the Eror</title>
	
<link rel="stylesheet" media="screen projection tv" href="/css/styles.css">

<body>

<!- --start slideshow-- -->

<div class="slideshow">	
  <img href="bird1.jpg" alt="Bird in flight"
  <img href="bird2.jpg alt="Bird in cage">
</div>

<script type="text/java" src="/js/jquery.cycle.lite.min.js"></script>
<script type="text/script" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
</body>
</html>

[edit][COLOR=“#FF0000”]OK folks, the competition part of this thread is now over, though you are welcome to discuss further the issues involved.

Results can be seen in post #67.[/COLOR][/edit]

The person who asked for help says they are not good with java but Java is a programming language not a scripting language used int his context
Line 1 Should read <!DOCTYPE html> it is missing the !
Line 2 Should read <html lang=“en”> not <html lang=“em”>
Line 5 should read <meta charset=“utf-8”> It was missing the hyphen in utf8 but also should read <meta http-equiv=“Content-Type” content=“text/html; charset=UTF-8” />
Line 7 Error is misspelled as Eror
Line 9 should have commas (,) between screen and projection and tv
Line 10 </head> is missing
Line 16 is missing the closing >
Line 17 should read <img href=“bird2.jpg” alt=“Bird in cage”> not <img href=“bird2.jpg alt=“Bird in cage”> It was missing the quote after the href
Line 20 is wrong. it should read <script type=“text/javascript” src=”/js/jquery.cycle.lite.min.js"></script> not <script type=“text/java” src=“/js/jquery.cycle.lite.min.js”></script> Javascript and Java are completely different. Java is an OOP language and JavaScript is an OO scripting language. Java must be compiled where Javascript does not
Line 21 should read <script type=“text/javascript” src=“https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js”></script> not <script type=“text/script” src=“https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js”></script>
Lines 20 and 21 should be placed in the head. The Javascript libraries are needed to make the animations work. If they are placed at the end of the document they are loaded after the HTML page is loaded

Here’s my attempt.

<DOCTYPE html>
  1. I would put “html” in caps. However, I don’t think it matters too much.
<html lang="em">
  1. The "em should be “en” for English.
<meta charset="utf8">

3.The meta charset is missing a dash. It should read “utf-8” in the quotes.
4. </head> is missing

<img href="bird1.jpg" alt="Bird in flight"
<img href="bird2.jpg alt="Bird in cage">
  1. This section is missing a > and ". It should look like this:
<img href="bird1.jpg" alt="Bird in flight">
<img href="bird2.jpg" alt="Bird in cage">
<script type="text/java" src="/js/jquery.cycle.lite.min.js"></script>
<script type="text/script" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  1. The scripts should read as “text/javascript” in the quotes, instead of type=“text/java” or type=“text/script”.
  2. Also, the scripts should probably be inside the <head></head> tags. Unless there is some script specific reason it is down there.
  3. I think there should be a separate stylesheet for each media Instead of there being one for “screen projection tv”.

I’ve probably missed something. Worse, I may have made a mistake. Oh well, It’s just for fun.

Oh yeah, and doctype is missing the !

Opps. Too late now.

I can see quite a few more myself so keep looking. But I cannot complete. :cool:

This looked like fun so her is my shot at it

The original poster’s text has many errors. The sentence would make much more sense if written
like this:

  1. It would make more grammatical sense to add a “they are” at
    the end of the first sentence.
  2. Needs an ’ between I and d ) - I’d
  3. greatful is misspelled and should be grateful
  4. Should not be whomever but whoever
  5. Need to add the word “to” between able and help.
  6. Another ’ is needed between I and m - I’m
  7. I would not correct the error on the OP writing java as
    it is a common mistake to new coders, so he might have written java
    actually thinking it was java.

Code Section:

  1. ! missing from doctype so it should be <!DOCTYPE html>
  2. lang=“em” should be changed to lang=“en” for english
  3. meta tagshould be set as <meta http-equiv=“content-type” content=“text/html;charset=UTF-8”>
  4. Error is spelled wrong in the title tag
  5. media attribute should be media=“screen, projection, tv” and the href=“” should not contain a / at the beginninng of css or it will not call the right relative path
  6. missing closing head tag </head>
  7. HTML comment should start with two dashes like <!–
  8. Image one should be like this instead: <img src=“bird1.jpg” alt=“Bird in flight”> (missing closing bracket, and needs to be src not href)
  9. Image two should look like this: <img src=“bird2.jpg” alt=“Bird in cage”> (Should be src not href and missing closing ")
  10. The script tag needs some work:
    Could do 1 of 2 things to fix this
    1. Change type to type=“text/javascript”
    2. Since this is the HTML5 DOCTYPE the user could actually just leave out
    the type attribute since HTML5 automatically uses text/javascript for
    any <script> tag by default
    Also need to remove the / before js in the src attribute
  11. Same as above for second script tag
  12. The scripts should be swapped since jquery.cycle.lite.min.js needs the jQuery loaded in order to run
  13. I would personally move the scripts to either the head section or after the body tag, but don’t think
    it is necessary to make the page function any better

Great responses so far, guys. You sure have eagle eyes. :slight_smile:

No, not too late. Well spotted. :slight_smile:

I can still see some more but you guys are getting closer. :slight_smile:

I’m going to have a go at this at lunch. I’ve already spotted one trap that loads of people have fallen into…

:smiley: :eyebrow: :wink:

In fact, EVERYONE so far has fallen in to!

Although I shouldn’t be too cocky, I’m sure I’ll fall in to one myself!

We eagerly await your list. :slight_smile:

Don’t worry, though. I don’t bite, and I’m not a know-it-all.

My comments below in orange

It was the comment about disqualification for false positives that got me checking that one very carefully! (There was a grammatical one as well that I wasn’t sure about so I left it out)

Right, here we go then… my attempted list!

SPAG

  1. ‘seem’ not ‘seems’
  2. ‘grateful’ not ‘greatful’
  3. ‘I’d’ not ‘Id’
  4. ‘whoever’ not ‘whomever’
  5. ‘able to’ not ‘able’
  6. ‘I’m’ not ‘Im’
  7. ‘JavaScript’ rather than ‘java’

GENERAL

  1. It would probably help if the poster described what problems they were having, and what they are intending to achieve. Although it’s not that much of a point because it could be picked up from context / it’s obvious what it’s meant to do!

Code

  1. Missing ! from Doctype
  2. lang=“en” not lang=“em”
  3. ‘UTF-8’ not ‘utf8’ (although case insensitive, the hyphen should be there)
  4. ‘Eror’ should be ‘Error’ in <title>
  5. Media attribute of link element must be a valid media query, so “screen, projection, tv”
  6. Comment must start with <!–, not <!-
  7. Comment cannot contain 2 consecutive hyphens even if it was a valid comment
  8. Comment cannot end with a hyphen
  9. <img> elements should have src attribute, not href
  10. First <img> element is missing its closing >
  11. Second <img> element is missing a quote
  12. The alt attribute for both images should contain a text alternative for the images, not a description of them
  13. The type attributes for both script tags should be “text/javascript”, or omitted entirely
  14. The src attribute of the second script could generate a browser warning if this page is not on a secure site, as it refers to secure content
  15. Arguably these scripts should be loaded in the document head
  16. The scripts are loaded in the wrong order - jQuery should be loaded before its plugin

That’s everything I can see I think… bound to have missed something though!

An additional one that I wasn’t sure whether to put in, but I think I will:

  1. Probably not the best idea to just load the latest 1.x.x version of jQuery - you should stick to a specific version in case future updates break things you are relying on

See I even added an error to my post. :wink:

Actually I like you Ralph; I see you’ve possibly got at least another sneaky one or two hidden there in the code. That they haven’t spotted between them. Might involve them explaining why those are possible errors though. :wink:

Stop taunting me!

Heh heh, as usual, people spotting things that didn’t even occur to the OP. Ahem. :lol: Great work! This is fun. :slight_smile: