繁体   English   中英

我需要使用ajax调用返回整个html页面

[英]i need to return an entire html page using an ajax call

我需要返回此页面的内容http://service.semanticproxy.com/processurl/ftfu27m3k66dvc3r43bzfneh/html/http://www.smallbiztechnology.com/archive/2013/12/why-creating-a-digital-storefront -is-crucial-for-your-small-business.html,但是当我调用此函数时

function getResult() {
            var url="http://service.semanticproxy.com/processurl/ftfu27m3k66dvc3r43bzfneh/html/http://www.smallbiztechnology.com/archive/2013/12/why-creating-a-digital-storefront-is-crucial-for-your-small-business.html";
            $.ajax({
                cache: true,
                url: url,
                success: function (result) {
                    alert(result);
                }
            });
        }

我在萤火虫中得到了这个:

segment.min.js(ligne 1)GET http://service.semanticproxy.com/processurl/ftfu...orefront-is-crucial-for-your-small-business.html 200 OK 379msA。

知道我如何获取该页面的内容吗?

此代码对您不起作用。 原因是您尝试检索的html页面不是有效的JAVASCRIPT文件(并且您也不能使用jsonp,因为它没有返回任何json字符串。)

您的解决方案是使用服务器脚本(例如php:

<?Php print file_get_contents(url); ?> 

)。

或者-如果您的网站是您的网站,请根据要求添加对脚本的响应。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM