Enhancing javascript fragment replacement.