append into preview, put adding js into fn object