[英]Including php page in html page
Here I'm trying to access some php page in html page. 在这里,我试图访问html页面中的一些php页面。 Both running on different servers one is on WAMP server and I can see the page in browser when I hit
两者都在不同的服务器上运行,其中一个在WAMP服务器上,当我点击时可以在浏览器中看到页面
http://localhost:8080/winnersphp/index.php
Now I'm trying to access that page in ajax load like in another html page running in different server (in Eclipse , which is jetty server (java)) in localhost and the page URL is 现在,我尝试以ajax负载访问该页面,就像在本地主机中不同服务器(在Eclipse中,是码头服务器(java))中运行的另一个html页面中一样,并且页面URL为
http://localhost:8888/includephp.html
and in this html page I'm using Jquery 在这个html页面中,我正在使用Jquery
<script>
$( document ).ready(function() {
$("#externalHeader").load("http://localhost:8080/winnersphp/index.php");
});
</script>
But no luck. 但是没有运气。 Is there any security issues ??
是否有任何安全问题? or domain issues ??
或网域问题?
Initially I thought about some domain issue, but both running on localhost. 最初,我想到了一些域问题,但两者都在localhost上运行。 Port causing any problem here ?
端口在这里引起什么问题?
Can some one point me what I'm missing here ? 有人可以指出我在这里缺少什么吗?
Looks like jQuery's .load()
method is similar to the .get()
function, which is subject to the same origin policy . 看起来jQuery的
.load()
方法类似于.get()
函数,后者受相同的原始策略约束。 This does, indeed, restrict against different port numbers. 实际上,这确实限制了不同的端口号。
If you can use JSONP , though, you can still accomplish your task by following this answer: https://stackoverflow.com/a/2099771/2482557 但是,如果可以使用JSONP ,您仍然可以按照以下答案完成任务: https : //stackoverflow.com/a/2099771/2482557
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.