JQuery的自动完成功能在Chrome但不是在Android的使用PhoneGap的工作 [英] JQuery Autocomplete working in Chrome but not in android using phonegap
问题描述
我有写简单code为自动完成搜索。
我正在开发使用PhoneGap的Android应用程序。我有写code为自动完成搜索和它的工作完美,但,当我要在Android上运行它不工作。
I have write simple code for Auto-complete for search. I am developing android application using PhoneGap. 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.
我使用同一个文件不是一个单一的change.Google Chrome的允许所以首先我总是测试它在浏览器中测试HTML 5数据库页面,然后复制所有文件到设备中。
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.
我加我从数据库中返回数组动态功能,并且也是在谷歌浏览器工作,我可以看到完美的结果按照数据库中。
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.
当我运行在设备中的code我总是得到如下错误:
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.
感谢您的阅读查询。
推荐答案
哦花了差不多后半天终于让我找到确切的解决方案。
Ohh after spent almost half day finally i found the exact solution.
问题在直播脚本URL。
Issue was in Live Script URL.
在样品code,他们已成立现场脚本网址,我还没有把它保存在本地。
In sample code they have set live script URL and i haven't save it at locally.
<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>
所以,可能是手机,所有的JS&安培; CSS没有加载所以由于这个原因,他们无法找到
So may be in mobile that all js & css haven't loading so due to that reason they are not able to find
'$(#pur_cat_text).autocomplete
和给我的错误。
在最后我有节省JS&放大器; CSS在本地,现在我能够运行我的code
At finally i have save both JS & CSS at locally and now i am able to run my code
这篇关于JQuery的自动完成功能在Chrome但不是在Android的使用PhoneGap的工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!