我尝试了许多不同的自动完成脚本 - 每次都出现相同的错误......使用链接或其他东西从页面 a 到页面 b 并且自动完成不再工作......
我有这样的来源
页 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>