JavaScript Hack: Prevent outputs from stacking in an HTML element by Joseph Palumbo

I'll often write a JavaScript function that populates an empty HTML element with some kind of output, either text or HTML. That's easy enough. The problem is that when/if function runs a second time, the second output is appended to the original output. 

I never had a good way to "reset" the target DIV when the function runs a second or third time. So I'm stuck with a long list of output stacked on each other. 

Last night I found a way to use an if statement to check if the target element already has something in it, and if it does, empty it out. 

Here it is. 

Screen Shot 2017-12-02 at 12.18.15 PM.jpg

The function in question outputs an HTML unordered list to a div with the id 'adv'. When the function runs, this logic checks the length of the HTML in the div and if it is greater than 0, it will empty it out. 

Definitely not saying this is the best way to handle a problem like this, but so far it has worked very nice for me so I thought I'd share. 

TLFAT: Lessons we can all learn from VA problems by Joseph Palumbo

Listening to NPR on my way into work this morning. A story about problems with the Veteran's Administration had a panel with a VA administrator, a military veteran, and somebody who worked for a firm that navigated the VA system on behalf of former soldiers. 

The key take away from this story is that designing to meet the needs of the "system" instead of meeting the needs of our users is a much more prevalent mistake than I thought. It appears that this happens outside of computer applications and extends to bureaucratic systems as well, specifically the VA. 

The bottomline is this - systems must be designed to meed the needs of users, not internal systems. Secondly, until this becomes a widespread maxim in business, there will always be a need for Customer Success Managers and Leaders.