Click here to Skip to main content
15,068,988 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

What I have tried:

I have confirmed that all the HTML tags embedded in the JavaScript code are all in quote
And also, I have check the letters to make sure that they are the same
Updated 28-Aug-21 3:58am
Asif 7969814 28-Aug-21 9:52am
This Code will help you to do the same

<script type="text/javascript" src=""></script>
<style type="text/css">
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #000;
-khtml-opacity: 0.7;
opacity: 0.7;
z-index: 100;
display: none;
.cnt223 a{
text-decoration: none;
width: 100%;
margin: 0 auto;
display: none;
position: fixed;
z-index: 101;
min-width: 600px;
width: 600px;
min-height: 150px;
margin: 100px auto;
background: #f3f3f3;
position: relative;
z-index: 103;
padding: 15px 35px;
border-radius: 5px;
box-shadow: 0 2px 5px #000;
.cnt223 p{
clear: both;
    color: #555555;
    /* text-align: justify; */
    font-size: 20px;
    font-family: sans-serif;
.cnt223 p a{
color: #d91900;
font-weight: bold;
.cnt223 .x{
float: right;
height: 35px;
left: 22px;
position: relative;
top: -25px;
width: 34px;
.cnt223 .x:hover{
cursor: pointer;
<script type='text/javascript'>
var overlay = $('<div id="overlay"></div>');;
return false;


return false;
<div class='popup'>
<div class='cnt223'>
<h1>Important Notice</h1>
We were affected by the fire next door and will remain closed until further notice.
<a href='' class='close'>Close</a>

Don't declare it within the body of a different function - these are called "nested functions" when you do that..
Nested functions are only available within the body of the function they are defined in: nothing outside that can access them. And that includes the HTML!
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:

function closeWin(popup_new)

           function popupwin_prop(popup_text)
  ' ', 'newWin',  'width=300, height=100');
           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";


<body onLoad="Adver_popup()">
		<font face="comic sans, century gothic" size="-3">
		Market online<br>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900