How to use Jquery in the Cordova project?

Asked

Viewed 367 times

0

I started an open source hybrid project in HTML, CSS and Javascript using Cordova. I added Jquery, but I can’t use its features. Is there some mistake on my part?
The code can be viewed here.
When implementing the project, the linha 17, for example, it does not do what it should (add the text inside the div of linha 26).

1 answer

1


You need to call the code inside a $(document).ready() or equivalent:

<script>
  $(function(){
     var curso = controller.getNomeCurso();
     $("#curso").text(curso);
  });
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.