It doesn't work for me using IE9.
Go to HTML mode and paste in (remove _REMOVE_):
<a href="j_REMOVE_avascript: window.confirm('close window?');">test link</a>
Switch back to NORMAL and then HTML again and you will see:
<a href="j a v a s c r i p t: window.confirm(" close window?');"close window?');">test link</a>
I could not reproduce in Chrome. What browser are you testing with?
UPDATE: Looks like this is an IE only issue. I could not reproduce with Chrome, Firefox, Safari, and Opera.