Creating a pop up

Posted on 2005-04-06
Last Modified: 2013-11-28
Hi folks,
I was looking for help from someone to tell me how to do a pop up window for my site.
When someone clicks on a web page, ie info page, a pop up window will appear and it will allow them to sign up to a mailing list.
How do I do this? I used the code from a pop up generator software but when I tested it out, it wouldnt pop up!
Where does the code go?

All the best,
Question by:kwaoc
    LVL 1

    Accepted Solution

    You can use fowlling code and change name linktoPopuphere.html to your signup page.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    function MM_openBrWindow(theURL,winName,features) { //v2.0,winName,features);

    <body onclick="MM_openBrWindow('linktoPopuphere.html','signup','width=200,height=200')">
    LVL 1

    Author Comment

    If someone signs up for the newsletter, will this pop up still keep coming up on their pc when they visit my site again?
    LVL 1

    Expert Comment

     In that case, you have to use cookies to mark if that user signed up your newsletter or not.
    LVL 5

    Expert Comment


    Here's a script you can use to make a window popup only once. It's from the SimplyTheBest website.

    You can adjust it according to your needs.


    <SCRIPT LANGUAGE="JavaScript">
    // Courtesy of -
    <!-- Begin

    var expDays = 1; // number of days the cookie should last
    var page = "signup.htm";
    var windowprops = "width=300,height=200,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes";
    function GetCookie (name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
    return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break;
    return null;
    function SetCookie (name, value) {
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    var expires = (argc > 2) ? argv[2] : null;
    var path = (argc > 3) ? argv[3] : null;
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    document.cookie = name + "=" + escape (value) +
    ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
    ((path == null) ? "" : ("; path=" + path)) +
    ((domain == null) ? "" : ("; domain=" + domain)) +
    ((secure == true) ? "; secure" : "");
    function DeleteCookie (name) {
    var exp = new Date();
    exp.setTime (exp.getTime() - 1);
    var cval = GetCookie (name);
    document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
    var exp = new Date();
    exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
    function amt(){
    var count = GetCookie('count')
    if(count == null) {
    return 1
    else {
    var newcount = parseInt(count) + 1;
    return count
    function getCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
    endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
    function checkCount() {
    var count = GetCookie('count');
    if (count == null) {
    SetCookie('count', count, exp);, "", windowprops);
    else {
    SetCookie('count', count, exp);
    // End -->

    <body onLoad= "checkCount()" bgcolor="#99CC99" link="#003565" vlink="#003565" alink="#003565" leftmargin="0" topmargin="0">
    LVL 1

    Expert Comment

     Yes, it is ok.  Kwaoc,you can use it.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Read about why website design really matters in today's demanding market.
    Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
    The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
    The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: : Click on Too…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now