首页 > 微信 > 详细

app中嵌套微信公众号文章链接

时间:2018-07-27 20:22:27      阅读:357      评论:0      收藏:0      [点我收藏+]
        if (article && article.RefferID) {
            $.ajaxPrefilter(function (options) {
                if (options.crossDomain) {
                    let http = (window.location.protocol === ‘http:‘ ? ‘http:‘ : ‘https:‘);
                    options.url = http + ‘//cors-anywhere.herokuapp.com/‘ + options.url;
                };
            });

            let showSrc = article.SourceUrl;//链接地址
            $.get(showSrc, function (response) {
                let html = response;
                // 确保图片显示
                html = html.replace(/data-src/g, "src").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/g, ‘‘).replace(/https/g, ‘http‘);
                let html_src = ‘data:text/html;charset=utf-8,‘ + html;
                $(‘#iframe‘).attr("src", html_src);
            });
        }

 

app中嵌套微信公众号文章链接

原文:https://www.cnblogs.com/sjw-dmwz/p/9379194.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!