4

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.

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.

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.

Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85

1 Answers1

5

Ohh after spent almost half day finally i found the exact solution.

Issue was in Live Script URL.

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>

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' and giving me error.

At finally i have save both JS & CSS at locally and now i am able to run my code

Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85