This happened to my KJ a few weeks ago, along with some other weird electrical problems (brakes were acting like turn signals, rear lights went out when brake was applied, etc).
Turned out it was a loose grounding wire, but man was it annoying while it lasted.