0

我正在使用 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>
4

1 回答 1

0

只需尝试替换:

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

经过:

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

要不就:

$('.edit').editable('save.php', {
于 2013-04-30T16:59:12.887 回答