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

        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中嵌套微信公众号文章链接

上一篇:cocos creator android之微信开放平台修改签名 baseResp.errCode=-6


下一篇:微信小程序之if操作