iframe 引用微信公众号文章图片不显示问题

$.ajaxPrefilter(function(options) {
  if(options.crossDomain && jQuery.support.cors) {
    var http = (window.location.protocol === 'http:' ? 'http:' : 'https:');
    options.url = http + '//cors-anywhere.herokuapp.com/' + options.url;
  }
});
$.ajax({
  crossOrigin: true,
  url: goUrl,
  success: function(data) {
    data = data.replace(/data-src/g, "src");
    var sourceHtml = 'data:text/html;charset=utf-8,' + data;
    $("#homepageIframe").attr("src" , sourceHtml);
  }
});

你可能感兴趣的:(前端)