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

258
Vistas
Reload new url using js

I am opening a file on the new tab using window.open('filepath'). i want to reload the new url once it is opened.how can i achieve this? I tried the below code but the new url is not reloading once it is opened.

var newurl = window.open('filepath','_blank');
window.location.reload();
        or
window.location.reload(newurl);

edited: Actually i am opening the content of the xml file on new url. when the file is opened on new tab it contains the previous data not the updated content. it is showing the updated content only upon reloading. The updated content will be shown on my local even if i do not reload the page but in some other site.It is not working without reloading.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

let say you want to open google.com,like this

For FireFox

let tab=window.open("https://www.google.com","_blank") now to reload it you need to do something like this

tab.self.location.replace("https://www.google.com")

this will cause tab to reload the url,hope this will help

For chrome

with chrome it will only work if the script try to open the same origin URL,i.e both tab have same origin

tab.location.reload()

about 4 years ago · Juan Pablo Isaza Denunciar

0

You access the window of the opened window given you don't violate CORS

const newurl = window.open('filepath', '_blank');
if (newurl) { // check if null, FireFox returns null
    newurl.location.reload();
}
about 4 years ago · Juan Pablo Isaza Denunciar
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