我使用x-editable引导程序,我试图让它工作一旦点击x-editable的保存按钮应该执行php文件.
我已经尝试了我所知道的一切来解决这个问题,但我不是一个铁杆的javascript程序员,所以将它改为Json试一试是我的观点一点努力.
我已经阅读了x-editable的文档,这应该是使用它的方法.
所以这是html:
<a href="#" class="username">superuser</a>
Run Code Online (Sandbox Code Playgroud)
Javascript:
$.fn.editable.defaults.mode = 'inline';
$('.username').editable({
type: 'text',
pk: 1,
url: 'post.php',
});
Run Code Online (Sandbox Code Playgroud)
一旦post.php丢失,x-editable就会出错,但是如果它看到php文件就什么都不做.来自php文件的内容是无关紧要的,因为那里只有一个带有测试的控制台日志.
控制台日志永远不会被执行,我无法弄清楚为什么它不工作,我已经看到1或2个问题,如Stackoverflow上的东西等,但没有使用完整的信息.
这是我第一次在互联网上问一些东西,所以我希望有人能帮助我解决这个问题.
我试着之类的东西改变url到localhost/dir/etc但是没有效果.还设置/posturl,并添加var posturl = "post.php";没有帮助
哦,我已经测试了所有资源:但如果它有帮助:
<!-- Le styles -->
<!-- jQUERY -->
<script src="http://code.jquery.com/jquery.js"></script>
<!-- Sharre -->
<script src="recources/assets/js/jquery.sharrre-1.3.4.js"></script>
<!-- Minnified bootstrap -->
<script src="recources/assets/min/js/bootstrap.min.js"></script>
<!-- Custom CSS -->
<link href="recources/assets/css/pagestyle.css" rel="stylesheet">
<!-- X - Editable -->
<link href="recources/assets/css/bootstrap-editable.css" rel="stylesheet">
<!-- External link -->
<script src="//cdnjs.cloudflare.com/ajax/libs/x-editable/1.4.4/bootstrap-editable/js/bootstrap-editable.min.js"></script>
Run Code Online (Sandbox Code Playgroud)