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

197
Vistas
How do you write Javascript to open page and then click on button on page in one go

I would like to open a particular webpage and then click on a button to open another page from that page. Now I can see how to write Javascript to find a button on page and click on it, what I dont quite understand how I can do that from the 1st page.

i.e on Page 1 can open Page 2, but how do I in one go from page 1 get it to click on a button on page 2 once page 2 is loaded because until Page 2 is loaded the button is not available, and if I just go to Page 2 my Javascript will not be running because that was on Page 1 ?

What I am trying to do is a poweruser feature that makes it easier to do a particular repetitive task, I am the sys adminstator for page 1 but not page 2.

This is example of the page Im trying to do this for

https://acoustid.org/track/61c9656b-6838-4660-8113-86f7f90fd549

You need to login to Acoustid to actually see the Disable buttons

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

0

Open new browser window with js (modal or tab)

var newWindow = window.open("http://www.....com");

Add onload handler for new window and insert script (optionally)

newWindow.addEventListener("DOMContentLoaded", Func);

function Func()
{
    var script = newWindow.document.createElement("script");
    script.text = "alert('hello');";
    newWindow.document.body.appendChild(script);
}

Insert js code straightforwardly if you don't need to handle load

Func();
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