call a function on js
open a file and find json data type