jquery自动给img src添加域名前缀,方法如下:
$(function() {
$('#box img').attr('src', function(index, src) {
return 'http://www.lanniaofei.com/' + this.getAttribute('src');
});
});
</script>
<div class="contxt" id='box'>
<img alt="" src="
/d/file/p/2018/12-29/5f2988c20340d9a09030ac9dabf7d133.jpg" />
</div>