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

164
Visualizações
How do I open a new window and show an alert in it?

I have created two html files (missions.html and missionInfo.html). In missions.html , I have called a function "open" which is defined in a java script file and is as follows:

function open()   
{   
    alert("Hello");   
    window.open("missionInfo.html" , "_self");   
    alert("Hello Again");   
} 

I want to show an alert box saying "Hello" in missions.html then open missionInfo.html and in this newly opened file I want to show an alert box saying "Hello Again" . But when I'm calling this function in mission.html it isn't executing completely . It shows first alert box then opens the missionInfo.html file and then stops executing . It is not showing the second alert box which was supposed to be shown in missionInfo.html

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

this is a fairly simple task anyway.

At first, you have one page say, index.html in which when you defined open function in it to open a new document missionInfo.html.

All you have to do is just add code to show an alert on the missionInfo.html page.

So now your missionInfo.html should look like this:

<!DOCTYPE html>
<html lang="en">
<head>
    ...
    <title>Test</title>
</head>
<body>
    ... 
    <script>
        alert('Hello from Mission Info')
    </script>
</body>
</html>

That's it!

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