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

232
Views
Cómo cerrar la ventana actual del navegador y abrir una nueva ventana usando JavaScript

Estoy tratando de cerrar el navegador de Windows actual y abrir uno nuevo. Actualmente, abre una nueva ventana en cada clic que no es correcta.

¿No estoy seguro de dónde estoy haciendo mal en esto?

¿Puede alguien señalarme la dirección correcta?

 <div id="oWrapper" style="display: none;"> <div id="oIn"></div> </div> $(document).ready(function () { var isIE = false || !!document.documentMode; if (isIE) { var tURL = 'microsoft-edge:' + '@Url'.replace(/amp;/g, ''); var openE = document.querySelector('#oIn'); openE.href = 'microsoft-edge:' + document.URL; var oWrapper = document.querySelector('#oWrapper'); oWrapper.style.display = 'block'; window.location.replace(tURL); } else { var params = [ 'height=' + screen.height, 'width=' + screen.width, 'scrollbars=yes', 'resizable=yes', 'location=no' ].join(','); var Obj; function ModalPopUp() { Obj = window.open('@Url'.replace(/amp;/g, ''), "_blank", params); Obj.moveTo(0, 0); Obj.focus(); LoadModal(); } function LoadModal() { var Div = document.getElementById("oIn"); Div.style.display = "block"; } function OnUnload() { if (false == Obj.closed) { Obj.close(); } } window.onunload = OnUnload; ModalPop(); } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Parece que solo intentas Obj.cerrar en window.onunload, en lugar de antes de que se abra un nuevo modal.

Probar:

 function ModalPopUp() { if (Obj) Obj.close(); // close existing modal if it exists Obj = window.open('@Url'.replace(/amp;/g, ''), "_blank", params); Obj.moveTo(0, 0); Obj.focus(); LoadModal(); }
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!