Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda