Encode all data into js