change source of data to json from inside js script