JS图片src转义

var _Url = "/qfy_Angular/Pubimg/merchant.jpg"

str +='<img  onerror="this.onerror=null||undefined;this.src=\'' + _Url + '\'"/>'

原文地址:https://www.cnblogs.com/CMing/p/6710128.html