self write some javascript tool