/    Sign up×
Community /Pin to ProfileBookmark

How to correct JavaScript code

I am a Web Design teacher, as part of my program I teach JavaScript. My students do their assignments and most times they do not work. After reviewing the code it looks correct. I am thinking that they are using the backspace to make corrections and this is causing them problems but I am not sure. If I cut and past my code into there it works. Can anyone help me with this issue?

Thanks,

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@Sterling_IsfineAug 11.2009 — What makes you think that using the backspace key can cause problems? It's the resulting code that matters, not the keys used to create it.

If code doesn't work, the first thing that the students should be taught to do is to check the error console.

You do know about the error console don't you teacher?
Copy linkTweet thisAlerts:
@jflintauthorAug 12.2009 — I do know about the error console and sometimes there is error information and sometimes there is not. I even have them validate there code. I and just asking if anyone can thing of any reason this might be happening. If I should be looking else where I will.
Copy linkTweet thisAlerts:
@TheBearMayAug 12.2009 — In spite of Sterling's somewhat obnoxious reply, he is correct in that the resulting code is what matters, not how it got there. Using the backspace in an editor doesn't normally leave any trace of how the character was erased, just that it isn't there any more.
Copy linkTweet thisAlerts:
@jflintauthorAug 12.2009 — Thanks for your kind comments,
Copy linkTweet thisAlerts:
@TheBearMayAug 12.2009 — You do have my curiosity piqued though, can you tell me what editor they are using, and what message they are getting (or what makes them think they have an error)?
Copy linkTweet thisAlerts:
@thraddashAug 12.2009 — With what tool do you have them validate their code?

I personally use this site http://www.jslint.com/ (Javascript Validator), and really try my best to conform to their rules/suggestions.
Copy linkTweet thisAlerts:
@TheBearMayAug 13.2009 — Another thought. If they are checking their code on the server, you could be seeing a cached version of the code and not the current code (can also happen with certain browsers on the local).
×

Success!

Help @jflint spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...