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

256
Views
¿Cómo actualizar una pantalla automáticamente después de cerrar la ventana emergente?

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="Tokyo" class="tabcontent"> <br> <a href="file:///C:/xampp/htdocs/final/pop.html" class="a-tag" target="popup" onclick="window.open('file:///C:/xampp/htdocs/final/pop.html','popup',`width=600,height=400,top=${window.outerHeight/2 - 250},left=${window.outerWidth/2 - 300}`); return false;"> Click to Upload Files </a> </div> </body> </html>

Cuando hago clic en clic para cargar archivos, aparece una ventana emergente.

Aquí está mi ventana emergente:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <input type="file" multiple> </body> </html>

Quiero actualizar mi pantalla con la etiqueta de clic para cargar archivos, cada vez que cierre mi ventana emergente. ¿Cómo lograr esto? Gracias.

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

Puedes hacerlo:

 window.location.reload();

o puede usar window.location.href, este método vuelve a cargar la página. así que también puedes hacer esto:

 window.location.href = window.location.pathname + window.location.search + window.location.hash;
about 4 years ago · Juan Pablo Isaza Report

0

El OP quería una forma de identificar cuándo se cerró la ventana emergente antes de actualizar la página.

Puede asignar la ventana emergente a una variable y luego usar el evento window.onbeforeunload para determinar cuándo se cierra la ventana emergente.

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="Tokyo" class="tabcontent"> <br> <a href="file:///C:/xampp/htdocs/final/pop.html" class="a-tag" target="popup" onclick="onUserUpload()"> Click to Upload Files </a> </div> </body> </html>

 function onUserUpload(e) { let popup = window.open( 'file:///C:/xampp/htdocs/final/pop.html', 'popup', `width=600,height=400,top=${window.outerHeight/2 - 250},left=${window.outerWidth/2 - 300}` ); popup.addEventListner('beforeunload', function refreshOnClose(e) { //the event only fires after the popup window is closed if(Object.keys(e).length) { console.log('Popup is closed.'); popup.removeEventListener('beforeunload', refreshOnClose); //reload current window return window.location.reload(); } } })
about 4 years ago · Juan Pablo Isaza Report

0

window.reload()
 <form onsubmit="window.reload()"> <input type="file" multiple /> </form>
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!