在开发的时候使用Asp.net Ajax的AJaxtoolkit是很方便的,但是对于非asp.net页面就很不方便了,下面介绍一下在html/asp/php等非asp.net下调用autoComplete的webserives
HTML 页中加入
<script type="text/javascript" src="/JavaScript/MicrosoftAjaxWebForms.js"></script>
<script type="text/javascript" src="/JavaScript/Client/Common.js"></script>
<script type="text/javascript" src="/JavaScript/Client/Timer.js"></script>
<script type="text/javascript" src="/JavaScript/Client/Animations.js"></script>
<script type="text/javascript" src="/JavaScript/Client/BaseScripts.js"></script>
<script type="text/javascript" src="/JavaScript/Client/AnimationBehavior.js"></script>
<script type="text/javascript" src="/JavaScript/Client/PopupBehavior.js"></script>
<script type="text/javascript" src="/JavaScript/Client/AutoCompleteBehavior.js"></script>  
<input name="Username" type="text" id="Username" autocomplete="flase" />
<script type="text/javascript">
<!--
    $create(AjaxControlToolkit.AutoCompleteBehavior, {
"completionInterval":400,"completionSetCount":6,"delimiterCharacters":"","id":"autoComplete1","serviceMethod":"GetCompletionList","servicePath":"/WebServices/AutoComplete.asmx"}, nullnull, $get("Username"));
// -->
</script>

这样就可以在input上产生autoComplete效果

关键是JS引用的顺序不要错啊


邹健 2007-08-01 19:39 发表评论

文章来源:http://www.cnblogs.com/chsword/archive/2007/08/01/839437.html
posted on 2007-08-28 09:17  账号难注册  阅读(254)  评论(0编辑  收藏  举报