[英]i need to return an entire html page using an ajax call
i need to return the content of this page 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 but when i call this function 我需要返回此页面的内容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);
}
});
}
I got this in firebug: 我在萤火虫中得到了这个:
segment.min.js (ligne 1) GET http://service.semanticproxy.com/processurl/ftfu...orefront-is-crucial-for-your-small-business.html 200 OK 379msA. segment.min.js(ligne 1)GET http://service.semanticproxy.com/processurl/ftfu...orefront-is-crucial-for-your-small-business.html 200 OK 379msA。
Any idea how i can get the content of that page? 知道我如何获取该页面的内容吗?
This code won't work for you. 此代码对您不起作用。 the reason is that the html page you are trying to retrieve is not a valid JAVASCRIPT file (and you also can't use jsonp because it is not returning any json string.) 原因是您尝试检索的html页面不是有效的JAVASCRIPT文件(并且您也不能使用jsonp,因为它没有返回任何json字符串。)
Your solution is to use a server script (such as php: 您的解决方案是使用服务器脚本(例如php:
<?Php print file_get_contents(url); ?>
). )。
OR - if the website is yours , add a response to the script on request. 或者-如果您的网站是您的网站,请根据要求添加对脚本的响应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.