javascript - External function call from JSNI is not working -


i trying translate javascript code jsni code.

script imports

<script src="jquery-1.11.2.min.js"></script> <script src="jquery.typeahead.min.js"></script> <script src="autocompletetest/autocompletetest.nocache.js"></script> 

script

$('#q').typeahead({       minlength: 1,       order: "asc",       group: true,        groupmaxitem: 6,       hint: true,       dropdownfilter: "all",       href: "https://en.wikipedia.org/?title={{display}}",       template: "{{display}}, <small><em>{{group}}</em></small>",       source: {           country: {               data: data.countries           },           capital: {               data: data.capitals           }       },     ... 

to

$doc.getelementsbyclassname("q").typeahead({     ... }) 

but i'm getting error:

@com.citi.sevi.client.autocompletetest::loadjquery()([]): $doc.getelementsbyclassname(...).typeahead not function 

what causing error?

jquery's $ function isn't getelementsbyclassname wrapper, wraps result in jquery object, plugins live. call typeahead method, have use $win.$("q")


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -