Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

449
Vistas
window.open() on ajax query has error in console:Uncaught (in promise) Error: Cannot read properties of undefined (reading 'allowlisted')

I'm opening a popup window after an click on my main page using jquery. The pop up window has a button that should call a function on click. Unfortunately, the opened window shows an error in the console. I should note that if I attach the window.close() function to my button, the console still shows the error but the button does close the window so perhaps I have multiple problems in my code.

JS:

function jb_log_js(jb) {
  console.log("jb_log_js lancée");
  $.ajax({type: 'POST',
  url: "http://127.0.0.1:5000/jb_log", 
  data: JSON.stringify(jb),
  success:function(data){console.log("jb_log_js callback");
  var win = window.open("", "Title", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=200,top="+(screen.height-400)+",left="+(screen.width-840));
  win.document.body.innerHTML = data;},
  contentType: 'application/json',
  dataType : 'json',
}
  );
  console.log("jb_log_js finie");
}

Python Flask:

@app.route('/jb_log',methods=['GET','POST'])
def jb_log_py():
    print("jb_log_py lancée")
    if request.method == 'POST':
        print("entrée if")
        print(request.is_json)
        print(request.get_json(force=True))
        liste_jb= request.get_json(force=True)
        print(liste_jb)
        template = render_template('jb_log.html',title="connexion",liste_jb = liste_jb)
        return json.dumps(template)

HTML:

<!DOCTYPE html>
<html>
<head>
<script src="{{ url_for('static', filename='jquery-3.6.0.js')}}"></script>
<script src="{{ url_for('static', filename='script.js')}}"></script>
</head>
<body>
    <div>
        <form>
            {% for jb in liste_jb %}
                <label for="identifiant">Identifiant pour {{jb}}:</label><br>
                <input type="text" id="identifiant" name="{{jb}}"><br>
                <label for="mdp">Mot de passe pour {{jb}}:</label><br>
                <input type="text" id="mdp" name = {{jb}}><br>
            {% endfor %}
            <input type="button" value="Valider" onclick="lancement_scraping()">
        </form>
    </div>
</body>

The console

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda