Place your message here

Your Guide to Professional
Web Site Design and Development

Web Development
HTML Codes
HTML Tips
Javascript Snippets
216 Safe Colors
Symbols
Web Directory
Web Resources
Internet Channels

Web Development: Business, Advertising, Internet Marketing, Promotion and Web Site Design

Sunday, March 30, 2025

| Web Development | HTML Codes | HTML Tips | Javascript Snippets | 216 Safe Colors | Symbols | Recommendations |

No-Kill Pop Box; Part III

By William Bontrager

This article provides the means to use cookies so your No-Kill Pop Box is displayed only once to a visitor for a pre-determined number of days.

     Part 1. "No-Kill Pop Box (Instead of Popups)"

        The basic code for creating a Pop Box.

     Part 2. "No-Kill Pop Box; Part II"

        Comparisons with focus on differences of the No-Kill
        Pop Box and Pop-ups/unders. Code for delayed opening
        of the No-Kill Pop Box and to open and close the
        No-Kill Pop Box with links.

The demo page contains the complete code necessary to implement the No-Kill Pop Box with cookies.

If you haven't read the other two articles in this series, I urge you to do so now. Unless you are a proficient JavaScript programmer, the rest of this article may make little sense until familiarity with the other two articles is attained.

The global variable and functions that were added since the second of this article series are:

     1. A global variable named DaysToLive

        Here, specify the number of days you want the
        cookie to live, a maximum of 3652 days, representing
        10 years. If you want the cookie to disappear when
        the browser is closed (called "session cookies"),
        specify 0 (zero) days.

     2. Function SetCookie()

        This is the function that sets the cookie when the
        No-Kill Pop Box is displayed.

     3. Function GetCookie()

        This function is used to determine whether or not
        the cookie exists in the browser.

     4. Function OpenPopBoxIfOkay()

        This function is called when a page first loads. It
        uses function GetCookie() to determine whether or
        not the No-Kill Pop Box should be displayed.

        Function OpenPopBoxIfOkay() must be called or the
        No-Kill Pop Box won't ever be displayed and no
        cookie will be set. The function can be called
        using any of the following methods:

          i. In the BODY tag itself with

onLoad="OpenPopBoxIfOkay()"

             Example:

<BODY onLoad="OpenPopBoxIfOkay()">

             The above calls the function as soon as the
             page completes loading.

         ii. Somewhere in the BODY area with

<script type="text/javascript" language="JavaScript"><!--
OpenPopBoxIfOkay();
//--></script>

             The above calls the function when the browser
             loads the code.

        iii. Somewhere in the BODY area with

<script type="text/javascript" language="JavaScript"><!--
setTimeout('OpenPopBoxIfOkay()',3000);
//--></script>

             The above calls the function 3 seconds after
             the browser loads the code. The number 3000
             in the above codes represents 3000 milliseconds
             delay. Adjust that number as appropriate for
             your installation.

You'll notice that the demonstration for this article contains a WillMaster Possibilities subscription form.

When a form is put into the No-Kill Pop Box and the form submitted, the "thank you" page will be a new page, like it would be if the form was submitted from a normal page -- the "thank you" page will not display inside the No-Kill Pop Box.

Because the No-Kill Pop Box is displayed only the one time, the "thank you" page can be the same page the form was submitted from. When the "thank you" page loads, the No-Kill Pop Box won't display because it has already been displayed once. In effect, the form user is sent to the same page the form was submitted from -- except the page no longer displays the form.

Note: Browsers with cookies disabled, will show the form
      every time the page loads. (I've never done a survey
      to determine how many cookies-disabled browsers visit
      our sites. I'm thinking the number is low, but I
      can't be certain.)

The first three parts of this series have provided the code necessary to use No-Kill Pop Boxes in a professional manner.

Will Bontrager

About the Author:

William Bontrager Programmer/Publisher, "WillMaster Possibilities" ezine mailto:possibilities@willmaster.com

Are you looking for top quality scripts? Visit Willmaster and check out his highly acclaimed Master Series scripts. Some free, some for a fee.


eTips Member Login

Enter your email address and password to enter the private membership area:
Email:
Password:

Lost Password?

Email:

Not yet a member?

Click here to see what you're missing! Club members receive access to dozens of free video tutorials, utilities and ebooks.

Our Products


Web Design Mastery
Mastering Web Hosting
eBook Starter

Our Other Sites


ShelleyLowery.com
Web Design Mastery
Learn How to Make a Web Page
Make My Own Website Guide
Email Newsletter Service
Mastering Web Hosting
eBook Starter
Raging Hearts
Online Forex Trading For Beginners
Beginners Real Estate Investing

Partner Sites


Site Build It!
Web Site Templates

Web Site Design


HTML Tips
PC Security
CSS Tutorial
HTML Codes
Web Design Tips
JavaScript Codes
JavaScript Tutorial
Java Applet Tutorial
216 Web Safe Colors
Web Site Development
ASCII Character Codes

Web Site Tools


Domain Search
Format Your Text
Create Meta Tags
Text to HTML Converter
Color Code Converter
CSS Generator
Bookmark Site Generator
Button Generator
Rollover Button Generator
Rollover Text Button Generator
Colored Scrollbar Generator
Table Generator
Article Syndication
Free Classified Ads

Follow Us




Daily News For
Webmasters

Back


| Web Site Development | HTML Codes | HTML Tips | Javascript Snippets |
| Web Resources | 216 Safe Colors | Symbols | Web Development Strategies |
| FeedBack | About | Privacy Policy | Terms and Conditions | Site Map | Affiliate Program |


Web-Source.net http://www.web-source.net
Your Guide to Professional Web Site Design and Development
Hosted with Host4Profit.
Copyright © 1997-2025 Brajusta Publishing, Inc., All Rights Reserved