Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

383
Views
Error de referencia no capturado: $ no está definido en la consola

Estoy tratando de agregar un div cuando se selecciona una casilla de verificación en la plantilla de dajngo, pero sigo recibiendo un error de Uncaught ReferenceError: $ is not defined en la consola

la plantilla:

 {% extends 'base_layout.html'%} {%load static%} {% block content %} <div class="inventory-content"> <div class='category'> <div>Categories</div> <div class='category-checkbox'> {%for category in categories%} <input type="checkbox" id="{{category.id}}" name="{{category.name}}" value="{{category.id}}"> <label for="{{category.name}}"> {{category.name}}</label><br> {%endfor%} </div> </div> <div class='items'></div> </div> <script> $('.category-checkbox input[type="checkbox"]').click(function (){ if ($(this).is(':checked')) { // Add the element to the div with an id identifier $('.items').append('<div id="[{{category.id}}]">123</div>'); } else { // Remove the element from the div targeted by the id identifier $('.items #[{{category.id}}]').remove(); } }); </script> {% endblock %}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

jquery en django tiene unalias de django.jQuery en lugar de $. Si desea usar $ en su lugar, puede hacer algo como esto:

 (function($) { //do some stuff with $ here })(django.jQuery);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!