handling javascript code