开发者

jquery error this.source is not a function

开发者 https://www.devze.com 2023-01-29 23:50 出处:网络
Hi I am trying to catch an array of string from a class called AjaxFacade using DWR and I am using jquery to autocomplete a text box snippetof myjsp code is as follows

Hi I am trying to catch an array of string from a class called AjaxFacade using DWR and I am using jquery to autocomplete a text box snippetof my jsp code is as follows

<%
 String path = request.getContextPath();
%>

<script type='text/javascript' src='<%=path%>/dwr/interface/ajaxFacade.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path%>/dwr/util.js'></script>

<script>

$(function() 
{
 var countries ;
 countries = ajaxFacade.getCountries();
 $("#tags").autocomplete({source : countries});
});

</script>

<tr>
<td align="left" valign="top" bgcolor="e3ddc7">
<div align="right"><strong> <font color="red">*</font>Old E-mail Address:</strong></div>
</td>
<td align="left开发者_如何转开发" valign="top" bgcolor="#FFFFFF">
<html:text name="amsUserRequestForm" property="oldEmail" size="20" styleClass="ui-widget" styleId="tags">
</html:text></td>
</tr>

Function in AjaxFacade class is as follows

public String[] getUsers() {

  String[] countries = {
      "India",
      "Iran",
      "Iraq",
      "Indoneshia",
      "Ireland"
      };
  return countries;
 }

No matter what I do it keeps me giving error this.source is not a function. Any help is greatly appreciated


make sure that the countries are filled with data make sync json call if needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消