<img id="contents2_img" alt="" src="images/hope.png" style="width: 100%; height:100%;border: none;">
<script> var image = ''; var cate = 10; $(document).ready(function () { $.ajax( { type: "GET", url: baseURL + 'api/articles/getArticlesList?catecode=10', data: {}, success: function (data) { if (data.code == 0 && data.articlesList.length>0) { var $data = data.articlesList[0].content; console.log($data) $("#contents2_img").attr('src', $data); // document.getElementById('contents2_img').src=$data; } } }); }) </script>