简体   繁体   English

JQuery Autocomplete在Chrome中工作但在android中没有使用phonegap

[英]JQuery Autocomplete working in Chrome but not in android using phonegap

I have write simple code for Auto-complete for search. 我为自动完成搜索编写了简单的代码。 I am developing android application using PhoneGap. 我正在使用PhoneGap开发android应用程序。 I have write code for Auto-complete for search and it's working perfectly but when i am going to run in android its not working. 我已经编写了自动完成搜索的代码,它工作得很好但是当我要在android中运行时它无法正常工作。

Here is the sample code 这是示例代码

I am using same file not a single change.Google Chrome is allow to test HTML 5 database pages so first i am always test it in browser and then copy that all files into device. 我使用相同的文件而不是一次更改.Google Chrome允许测试HTML 5数据库页面,所以首先我总是在浏览器中测试它,然后将所有文件复制到设备中。

Here is my code 这是我的代码

I have add my dynamic function which return array from database and that is also working in Google Chrome and i can see the perfect result as per the database. 我添加了我的动态函数,该函数从数据库返回数组,并且也在谷歌浏览器中工作,我可以根据数据库看到完美的结果。

When i run the code in device i always get below error : 当我在设备中运行代码时,我总是得到以下错误:

TypeError: Result of expression '$( "#pur_cat_text" ).autocomplete' [undefined] is not a function.

I don't know where is the issue and how to solve it. 我不知道问题在哪里以及如何解决。 Please guild be how can i solve this. 请公会,我该如何解决这个问题。

Thanks for read query. 感谢您阅读查询。

Ohh after spent almost half day finally i found the exact solution. 哦,花了将近半天后,我终于找到了确切的解决方案。

Issue was in Live Script URL. 问题出现在Live Script URL中。

In sample code they have set live script URL and i haven't save it at locally. 在示例代码中,他们设置了实时脚本URL,但我没有将其保存在本地。

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

So may be in mobile that all js & css haven't loading so due to that reason they are not able to find 因此可能在移动设备中所有js和css都没有加载,因此他们无法找到

'$( "#pur_cat_text" ).autocomplete' and giving me error. '$( "#pur_cat_text" ).autocomplete'并给我错误。

At finally i have save both JS & CSS at locally and now i am able to run my code 最后我在本地保存了JS和CSS,现在我可以运行我的代码了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM