Print a div with data from ajax or jquery.get()

前端 未结 3 1538
耶瑟儿~
耶瑟儿~ 2021-01-15 17:56

I have a div:

that gets populated by JQuery using innerHTML with strings from client side jav

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-15 18:15

    Go this way

    $('#contract').text(JSON.stringify(data));
    

    or

    $('#contract').append(
        $('
    ').text(
            JSON.stringify(data, null, '  ')
        )
    )
    

提交回复
热议问题