Access-Control-Allow-Origin不允许使用jquery.jeditable

时间:2013-04-30 16:56:42

标签: jquery

我正在使用jquery.jeditable,每次我提交时都会收到此错误:

XMLHttpRequest cannot load http://www.coacharabia.com/save.php. Origin http://coacharabia.com is not allowed by Access-Control-Allow-Origin. 

请注意,该文件和save.php位于同一文件夹中的同一服务器上。我正在使用的代码是:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jeditable/jquery.jeditable.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
     $('.edit').editable('http://www.coacharabia.com/save.php', {
         cancel    : 'Cancel',
         submit    : 'Save',
         indicator : '<img src="jeditable/img/indicator.gif">',
         tooltip   : 'Click to edit...'
     });

 });
</script>

1 个答案:

答案 0 :(得分:0)

试试替换:

$('.edit').editable('http://www.coacharabia.com/save.php', {

人:

$('.edit').editable('http://coacharabia.com/save.php', {

或者只是:

$('.edit').editable('save.php', {