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

236
Views
Recuperar datos sin actualizar la página con ajax en django

Puedo publicar con ajax, pero cuando quiero extraer datos sin actualizar la página, solo puedo hacerlo 2 veces, luego el botón pierde su función.

 <div> <input type="hidden" name="producecode" class="pcode" value="{{per.produceCode}}" /> <input type="hidden" name="useremail" class="uponequantity" value="{{user.username}}" /> <button class="btn btn-sm btn-primary upoq"><i class="fa fa-plus"></i></button> </div>

y jquery

 $(".upoq").on("click", function() { $(".uponequantity").attr("value", localStorage.getItem('key')); var producecode = $(this).parent().find(".pcode").val(); $.ajax({ type: "POST", url: "/uponequantity/", headers: { "X-CSRFToken": '{{csrf_token}}' }, data: { "producecode": $(this).parent().find(".pcode").val(), "useremail": $(".uponequantity").val(), }, success: function() { //window.location.assign('/basket/'+"?b="+$(".uponequantity").val()); $.ajax({ url: '/basket/' + "?b=" + $(".uponequantity").val(), headers: { "X-CSRFToken": '{{csrf_token}}' }, type: 'POST', success: function(result) { $('.basket').html(result); } }); } }); });
about 4 years ago · Juan Pablo Isaza
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!