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