add js function

Change-Id: Id97fd92b56e0150b79fbfddbdc79aa4175cac027