There were four errors function found on codepen
1. popupwin_prop should be close at line 11 and
2. popup_text is broken string at line no 17
3. settimeout is call wrong at line no 22
4. settimeout is call wrong at line no 10
Checkout this code:
Js:
function closeWin(popup_new)
{
popup_new.close();
}
function popupwin_prop(popup_text)
{
popup_new=window.open(' ', 'newWin', 'width=300, height=100');
popup_new.document.write(popup_text);
setTimeout(closeWin , 5000, popup_new);
}
function Adver_popup()
{
popup_text="<HTML>\n<HEAD>\n<TITTLE> online shopping .... Feel the difference</TITTLE>\n<body>\n";
popup_text = popup_text + "<center> \n <br>";
popup_text = popup_text + "<BODY bgcolor='aquamarine'>";
popup_text = popup_text + "<FONT COLOR='RED'> <p align='Center'>";
popup_text = popup_text + "<h2> Market online.... Enjoy</h2> </p> </FONT>";
popup_text = popup_text + "<center> \n <br>";
popup_text = popup_text + "</center> \n </BODY>\n</Html>\n";
setTimeout(popupwin_prop, 5000, popup_text);
}
document.bgcolor ="#ccffff";
document.write(navigator.appName);
Html:
<body onLoad="Adver_popup()">
<p>
<center>
<font face="comic sans, century gothic" size="-3">
Market online<br>
</center>
</p>
</body>