added javascript dealing