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

201
Views
¿Cómo puedo pasar window.screen al back-end a través de AJAX?

Si hago: window.screen , obtuve:

 Screen {availWidth: 3440, availHeight: 1415, width: 3440, height: 1440, colorDepth: 24, …}availHeight: 1415availLeft: -1057availTop: -1415availWidth: 3440colorDepth: 24height: 1440orientation: ScreenOrientation {angle: 0, type: 'landscape-primary', onchange: null}angle: 0onchange: nulltype: "landscape-primary"[[Prototype]]: ScreenOrientationpixelDepth: 24width: 3440[[Prototype]]: Screen

Así que asumo que puedo acceder a él, así que lo envié a mi back-end así:

 var data = {}; data.w = window.screen; //as soon as I did this, I can't never see request sent out in the network tab, if I changed that line to `data.w = 'test';`, only then I see request sending out again... $.ajax({ method: 'POST', url: '/tested-route', crossDomain: true, contentType: false, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('value'), "Accept": "application/json", "Content-Type": "application/x-www-form-urlencoded", "Cache-Control": "no-cache" }, data: data, success: function(response){ console.log(response); }, error: function(jqXHR, textStatus, errorThrown) { console.log(JSON.stringify(jqXHR)); console.log("AJAX error: " + textStatus + ' : ' + errorThrown); } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

JSON.stringify serializará las propiedades enumerables de un objeto.

Copie las propiedades que le interesan en un objeto nuevo y codifíquelas si desea codificarlas como JSON.

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!