added javascript and doc