Client JavaScript rewrite (Part. runJS&refreshPage)