Click here to Skip to main content
15,905,616 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: if and if not do it anyway Pin
David Skelly18-Dec-09 1:38
David Skelly18-Dec-09 1:38 
GeneralRe: if and if not do it anyway Pin
TorstenH.18-Dec-09 4:25
TorstenH.18-Dec-09 4:25 
GeneralRe: if and if not do it anyway Pin
PanchoM18-Dec-09 7:52
PanchoM18-Dec-09 7:52 
GeneralRe: if and if not do it anyway Pin
supercat918-Dec-09 8:22
supercat918-Dec-09 8:22 
GeneralRe: if and if not do it anyway Pin
TorstenH.20-Dec-09 20:19
TorstenH.20-Dec-09 20:19 
GeneralRe: if and if not do it anyway Pin
supercat921-Dec-09 4:33
supercat921-Dec-09 4:33 
GeneralRe: if and if not do it anyway Pin
RichardM130-Dec-09 10:49
RichardM130-Dec-09 10:49 
GeneralWho needs childNodes when you have innerHTML? Pin
ClementsDan17-Dec-09 13:55
ClementsDan17-Dec-09 13:55 
We have a webpage that contains a table with collapsible sections.   Straightforwardly, the code behind the show/hide links took the approach of (1) searching for the tr elements that need to be toggled, and (2) changing the .style.display property to "" or "none" as appropriate.

Less straightforwardly, step #1 was implemented not with DOM methods, but by searching the innerHTML for a string starting with "<TR ID=DISPFILE_".   In uppercase, so it wouldn't work on Firefox which normalizes the tag names to lowercase.

At least the original programmer was consistent: Step #2 was implement by a similar text search for "STYLE='display: none'".
GeneralNullabilityatastic Pin
Keith Barrow15-Dec-09 5:29
professionalKeith Barrow15-Dec-09 5:29 
JokeRe: Nullabilityatastic Pin
Jeroen De Dauw15-Dec-09 6:26
Jeroen De Dauw15-Dec-09 6:26 
JokeRe: Nullabilityatastic Pin
Ian Shlasko15-Dec-09 6:29
Ian Shlasko15-Dec-09 6:29 
GeneralRe: Nullabilityatastic [modified] Pin
Don Kackman16-Dec-09 8:57
Don Kackman16-Dec-09 8:57 
GeneralRe: Nullabilityatastic Pin
Super Lloyd16-Dec-09 10:53
Super Lloyd16-Dec-09 10:53 
JokeRe: Nullabilityatastic Pin
Jeremy Tierman17-Dec-09 5:49
Jeremy Tierman17-Dec-09 5:49 
GeneralRe: Nullabilityatastic Pin
BillW3319-Jan-10 10:45
professionalBillW3319-Jan-10 10:45 
GeneralRe: Nullabilityatastic Pin
Camilo Sanchez6-Feb-10 20:39
Camilo Sanchez6-Feb-10 20:39 
GeneralLet's just make sure? Pin
_Maxxx_14-Dec-09 18:54
professional_Maxxx_14-Dec-09 18:54 
GeneralRe: Let's just make sure? Pin
Peter_in_278014-Dec-09 19:09
professionalPeter_in_278014-Dec-09 19:09 
GeneralRe: Let's just make sure? Pin
Jeroen De Dauw15-Dec-09 4:22
Jeroen De Dauw15-Dec-09 4:22 
GeneralRe: Let's just make sure? Pin
Super Lloyd15-Dec-09 17:39
Super Lloyd15-Dec-09 17:39 
GeneralRe: Let's just make sure? Pin
Member 35753716-Dec-09 8:30
Member 35753716-Dec-09 8:30 
JokeRe: Let's just make sure? Pin
Super Lloyd16-Dec-09 10:47
Super Lloyd16-Dec-09 10:47 
GeneralRe: Let's just make sure? Pin
Super Lloyd16-Dec-09 11:57
Super Lloyd16-Dec-09 11:57 
GeneralRe: Let's just make sure? Pin
Member 35753717-Dec-09 5:26
Member 35753717-Dec-09 5:26 
GeneralRe: Let's just make sure? Pin
David Skelly17-Dec-09 22:38
David Skelly17-Dec-09 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.