Transferred the PHPCodeGenerator from html to js.