added random id generator to javascript examples