$.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;
  }
});

var share_link = "http://mp.weixin.qq.com/s/NVF_8CJNTwhvg-Zfa6yV3Q"; //微信文章地址
$.get(
  share_link,
  function(response) {
  //console.log("> ", response);
  var html = response;
  html = html.replace(/data-src/g, "src");
  var html_src = 'data:text/html;charset=utf-8,' + html;
  $("iframe").attr("src", html_src);
});

 

  

posted on 2017-04-25 13:56  前端小透明  阅读(3896)  评论(3编辑  收藏  举报