我正在尝试使用bootstrap x-editable,如下面的代码所示。我得到了最初显示的两个元素,但是当我点击其中任何一个时,我得到一个弹出窗口说:
<div class="editable-loading"></div>
此外,控制台会记录以下错误:
[12:38:17.817] NS_ERROR_FAILURE: Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIDOMHTMLInputElement.setSelectionRange] @ http://localhost/test/bootstrap-editable/js/bootstrap-editable.js:854
我错过了什么?
<link rel="stylesheet" type="text/css" href="bootstrap/css/bootstrap.css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap-editable/css/bootstrap-editable.css"/>
<script src="bootstrap-editable/js/bootstrap-editable.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a[data-role="editable"]').editable();
});
</script>
<a data-type="select" title="Select" data-role="editable" data-source="['one', 'two', 'three']"
data-placement="right" id="myid">Select test</a>
<a data-role="editable" title="Input" id="myid2" data-placement="right">Input test</a>
答案 0 :(得分:0)
看起来它可能与jquery / bootstrap / editable之间的版本不兼容有关。发现以下资源组合工作正常:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<link href="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/css/bootstrap- editable.css" rel="stylesheet">
<script src="http://vitalets.github.com/x-editable/assets/x-editable/bootstrap-editable/js/bootstrap-editable.js"></script>