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