ecam in javascript