A designer should understand the medium they are working in to the best of their abilities.
That said, there are architects that have never swung a hammer yet are lauded for their non-conformist buildings (that I'm sure more than one contractor has regretted building). :)
So...well, it depends. There are a lot of graphic designers that have never touched anything but PhotoShop. There are a lot of graphic designers that can use PhotoShop, build a PHP site, integrate a JS Library, and write all the presentation layer code.
Both are valid skill sets.
All that said, if you hope to be more of a UI designer than Graphic Designer--then I do think it's imperative that you understand the basics of JavaScript as JS is really the engine that creates the interaction layer. A huge part of web UI design these days is designing the details of the interaction--figuring out how long the fade is, which keyboard controls work against it, what touch vs. click will do, what is the hover state, error states, edge cases, accessibility, etc. This isn't possible with PhotoShop alone and one has to eventually get dirty with code to get into those particular details.
As for your follow-up question:
What if we just wanted someone to just pretty up our fully developed and functional web pages?
If the site is fully developed, it's not a matter of 'just prettying up'. There's only so much one can do AFTER the fact. Maybe swap out some images--maybe tweak the CSS. But ultimately the extent of what can be changed is going to be at the mercy of the existing presentation layer and you're going to need someone that fully understands it to even know where to start.
In the future, it's best to handle your visual design while the presentation layer is being developed--not afterwards.