sjw-dmwz
        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);
            });
        }

 

分类:

技术点:

相关文章: