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

452
Views
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
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!