加载页面时激活的 Scriptaculous 自动完成功能
有没有办法在页面加载时启动 Scriptaculous 的自动完成功能,使用输入字段中的默认单词进行搜索?
像这样的东西吗?
<input type="text" id="autocomplete" class="autocomplete_input" name="autocomplete_parameter" value="friends"/>
<span id="indicator1" style="display: none">
loading
</span>
<div id="autocomplete_choices" class="autocomplete">
</div>
<script type="text/javascript">
function AutoComp() {
var myAutoCompleter = new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "url", {indicator: 'indicator1',});
}
document.onLoad = AutoComp.activate();
</script>
Is there a way to fire up Scriptaculous's Autocomplete to search with the default word from the inputfield when the page is loaded?
Something like this?
<input type="text" id="autocomplete" class="autocomplete_input" name="autocomplete_parameter" value="friends"/>
<span id="indicator1" style="display: none">
loading
</span>
<div id="autocomplete_choices" class="autocomplete">
</div>
<script type="text/javascript">
function AutoComp() {
var myAutoCompleter = new Ajax.Autocompleter("autocomplete", "autocomplete_choices", "url", {indicator: 'indicator1',});
}
document.onLoad = AutoComp.activate();
</script>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的错!
这成功了
My fault!
This did the trick