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

245
Views
send information from a js variable to python

I need to send an object that contains a variable in js, the idea is to be able to send that information to python (I use django) and capture that info to be able to perform the validations that I need from the backend (python) and not from js, how can I do it ?

code ajax:

function CapturarDatosOrden() {

$.ajax({
    url: window.location.pathname,
    type: 'POST',
    data: {
        'action': 'prueba',
    },
    beforeSend: function (jqXHR) {
        $.xhrPool.push(jqXHR);

        $(".loader").fadeIn('fast');

    },
    dataType: 'json',

    complete: function (jqXHR) {
        // boton.disabled = false;           
        $('.loader').fadeOut('fast');
        var index = $.xhrPool.indexOf(jqXHR);
        if (index > -1) {
            $.xhrPool.splice(index, 1);
        }
    },
}).done(function (data) {
    // alert('entro al primer ajax para comparar el tipo de orden y su tecnologia')

    var info = data.find(data => data.id__ordenes == idOrden);

the "info" variable has the object I need to capture in python, the object is something like this:

{ id__ordenes: "219661981", fk_ot__tipo_orden: "4", fk_bss__contratos: "3257733", otciudad: "1", otdireccion: "----", fk_ot__cc: "1", open_orden: "42588165", instalador: "4320", fk_contratistas__equipos_vendedores: "1", fk_ot__causales: "88" }

how can i do it?

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!