JS:
$.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 link = "微信公众号平台链接";
$.get(
link,
function (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);
}
);
body: <iframe width="750" height="500" src=""></iframe>
//备注:如果微信公众号里有视频目前还在研究显示方案,图片和文字均可显示,如果有解决视频显示问题的小伙伴欢迎留言~