我尝试了很多不同的自动完成脚本 - 每次都出现同样的错误...... 使用链接或从页面a到页面b的其他内容,自动完成功能不再有效...
我有这样的来源
PAGE A ....
<script src="css/jqm.autoComplete-1.5.1-min.js"></script>
<div data-role="page" id="PAGE A" data-theme="a" >
<div data-role="header" data-id="header" data-position="fixed">
<input type="text" id="searchbox" placeholder="Suchbegriffe..." data-filter-theme="a">
</div>
<div data-role="content" >
<ul id="autocomplete_displ" data-role="listview" data-inset="true" style="margin-top: -20px;margin- bottom: 10px;" data-filter-theme="a"></ul>
</div>
</div>
<script>
$("#PAGE A").on("pageshow", function(e) {
$("#searchbox").autocomplete({
target: $('#autocomplete_displ'),
source: '../json.asp',
link: 'list_titles.asp?searchstring=',
minLength: 1
});
});
第B页 ....
<script src="css/jqm.autoComplete-1.5.1-min.js"></script>
<div data-role="page" id="PAGE B" data-theme="a" >
<div data-role="header" data-id="header" data-position="fixed">
<input type="text" id="searchbox" placeholder="Suchbegriffe..." data-filter-theme="a">
</div>
<div data-role="content" >
<ul id="autocomplete_displ" data-role="listview" data-inset="true" style="margin-top: -20px;margin- bottom: 10px;" data-filter-theme="a"></ul>
</div>
</div>
<script>
$("PAGE B").on("pageshow", function(e) {
$("#searchbox").autocomplete({
target: $('#autocomplete_displ'),
source: '../json.asp',
link: 'list_titles.asp?searchstring=',
minLength: 1
});
});
</script>
答案 0 :(得分:0)
解决了在标题中移动js的问题 - 当自动填充的输入字段位于标题中时...