Javascript Pet Peeves

For some reason people when writing javascript always seem to do 2 things that just drive me nuts!


One they camel case some html attributes like onChange , onClick .onMouseOver all html elements and attributes should be in lowercase

http://www.w3schools.com/html/html_elements.asp


http://www.w3.org/TR/xhtml1/#h-4.2



And they prepend their function with javascript: which is only useful in very few cases
http://jibbering.com/faq/#FAQ4_24



So you get this awful monstrosity that looks like onClick="javascript:doSomething()" when the proper way is to write it onclick="doSomething()"



I'll agree that it isn't a huge deal in most cases but there is a right and wrong way to do somethings and wish people would do it the right way, oh well I guess thats why they call it a Pet Peeve.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Where spellcheqk is just another word.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today