我正在尝试使用“简单评论”,但与它设置的相对路径挣扎。Javascript - 相对路径不正确?
我以为第一行会设置目录,以便第二次提到的路径会假设它在同一个地方..但显然不是!
任何人都可以帮忙吗?
设置:运行在一个单独的网站,该网站的代码是
<script type="text/javascript" src="http://www.anotherwebsite.co.uk/easycomment/jquery.easy-comment.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#my-comment,#your-comment,#is-this-ok-comment,#news-ting").EasyComment({
path:"/easycomment/",
moderate:true,
maxReply:5
});
});
</script>
我试着加入完整的HTTP易点评:随着
//为路径的第二次提到,但它的错误XMLHttpRequest无法加载http://anotherwebsite.co.uk/easycomment/ec-comment.php。 Access-Control-Allow-Origin不允许原产地http://www.thiswebsite.com。
跨域AJAX是不允许 – Austin 2012-08-09 14:37:59
你可以设置http头来接受来自第一个域的请求,否则你不能:它被禁止。 – Ricola3D 2012-08-09 14:41:20
谢谢Ricola,你能给我一个如何实现的例子吗?对不起,这对我来说都是新的 – flatcap 2012-08-09 14:53:01