[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

call function in jquery script

Hi.

I got my jquery script and I would like to call the function $("#autocomplete").autocomplete when I click.

$(function(){
      $("#autocomplete").click(function(e) {
            
            CALL The autocomplete function
      }),
      $("#autocomplete").autocomplete({ function })
0
bongii
Asked:
bongii
  • 4
  • 3
  • 2
4 Solutions
 
chaitu chaituCommented:
u mean like this.

(function(){
      $("#autocomplete").click(function(e) {
            autocomplete();
                  });

0
 
bongiiAuthor Commented:
Then i get an error:

error: autocomplete is not a function
0
 
Roman GhermanCommented:
$(function(){
      $("#autocomplete").click(function(e) {
           
                  $(this).autocomplete({ function })
      }),
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
bongiiAuthor Commented:
But I want to call autocomplete.

autocomplete has a lot of code.

0
 
Roman GhermanCommented:
$(this) will reference to  $("#autocomplete")

what do you want to do really?
0
 
bongiiAuthor Commented:
Thanks guys. Now it works :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now