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

163
Vistas
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 Respuestas
Responde la pregunta

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 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