• Home
  • Download Free eBook
  • OC Archives
  • Tools I Use
  • Webmaster Forum
  • Write For Us
Logo

  • Discounts
  • SEO Central
    • All other Search
    • Bing
    • Google Central
    • Yahoo
  • Social Networks
    • Digg
    • facebook
    • Squidoo
    • Technorati
    • Twitter
  • Web Design & Development
    • Ajax
    • Coding
    • Database
    • Graphic Design
    • Joomla
    • jQuery
    • OScommerce
    • Photoshop
  • Webmaster Central
    • Author's Corner
    • Case Studies
    • Content Writing
    • Featured Interviews
    • Guest Posts
    • Make Money Online
    • OC Promos
    • Premium Reviews
    • Video Tutorials
    • Web Hosting
    • Web News
    • Web Security
  • Wordpress

How to display Exit Splash or Exit message for wordpress Blog or website

Posted by Joshu on Oct 13, 2010 in Web Design & Development, Webmaster Central, Wordpress | 13 comments

How to display Exit Splash or Exit message for wordpress Blog or website

On the web I have come across a number of request for a “working” method for displaying an Exit splash or an Exit javascript message . An exit splash is basically a browser based pop-up message that is shown using a simple java script function to convey a message to the user leaving the website, requesting to subscribe or stay for more offers. This method helps drastically to improve the website traffic and retain traffic. Also it helps as a very effective marketing strategy on the internet now-a-days. Below is a tutorial that helps you to achieve this in 2 steps.

Step 1: Copy the below script and paste inside the <head> </head> tags of your website or blog header. If it’s a wordpress blog, in the themes – > header.php would contain both the header and the body tags.

<script language=”JavaScript”>
<!–

function CreateCookie(name, value, expiredays)
{
var todayDate = new Date();
todayDate.setDate(todayDate.getDate() + expiredays);
document.cookie = name + ” = ” + value + “; expires=” +
todayDate.toGMTString() + “;”;
}

function ReadCookie(cookiename)
{
var numOfCookies = document.cookie.length;
var nameOfCookie = cookiename + “=”;
var cookieLen = nameOfCookie.length;
var x=0;
while (x <= numOfCookies)
{
var y = (x + cookieLen);
if (document.cookie.substring(x, y) == nameOfCookie)
return(ExtractCookieValue (y));
x = document.cookie.indexOf(” “, x) + 1;
if (x == 0)
break;
}
return null;
}

function ExtractCookieValue(val)
{
if ((endOfCookie = document.cookie.indexOf(“;”,val)) == -1)
{
endOfCookie = document.cookie.length;
}
return unescape(document.cookie.substring(val, endOfCookie));
}

function GoodBye()
{

// This is what the prompt will ask the visitor when they leave your website.

if (confirm(” We would request you to sign up for the OrangeCopper Blog weekly newsletter before leaving – Click OK “))
{

// This is what the prompt will say if they choose to see what you asked above.

alert(” Thank you!  Please fill your email in top right corner form on the Blog page loading “);
window.open(“http://www.orangecopper.com/blog“);
}
else
{

// This is what the prompt will say if they choose to not see what you asked

alert(” No Problem, see you again Good Luck! “);
return false;
}
}

function MainGoodBye()
{
var userCookie = ReadCookie(“_chups”);
if (userCookie == null)
{

// User is here at first time
// propose to visit site

GoodBye();
//create coockie key (30 days)
CreateCookie(“_chups”, 1, 30);
}
}
//–>
</script>

Step 2

Find the <Body>  tag in your webpage or blog header.php and replace it with

<body onunload=”MainGoodBye()”>

Upload and you are done!! (feel free to edit the exit messages marked in blue as per your requirement).

Note: I thought this could help you and save a lot of time and money as there are websites who even charge for plugins and scripts that is as simple as this. Cheers !!

Site Tool Center(script credit)


Related Articles You Are Probably Interested In:

  1. List of Best Q&A script for website or WordPress blog
  2. How to Display Random WordPress Posts on a Page
  3. What is a FavIcon and How to create one for your website.
  4. How to hide Affiliate links on your website or blog: Tutorial
  5. How to use your very own Blog more resourcefully
  6. How to Transfer / Migrate / Back up your wordpress blog
  7. How to convert static HTML website to wordpress
  8. User Generated Content website using WordPress CMS

13 Responses to “How to display Exit Splash or Exit message for wordpress Blog or website”

  1. mark says:
    February 3, 2011 at 10:58 pm

    what the hell?

    i can’t copy those text..used chrome and firefox

    Reply
    • Joshu says:
      February 3, 2011 at 11:13 pm

      Mark,

      I regret the inconvenience created to you.
      The website is coded in such a way to avoid text selection and content theft. this feature is enabled for most spammy geo locations based on IP. That could be the reason you could not copy for your use. I have your email adress, have emailed you a copy of what you were looking for.

      Hope that helped you.
      Cheers, Josh

      Reply
  2. John says:
    February 4, 2011 at 2:26 am

    Hello Joshu. I’m John and would like to have the code too. Can you send it to my email? Thanks for your consideration :-)

    Reply
    • Joshu says:
      February 4, 2011 at 3:48 am

      Sure John,

      It has been emailed to you!
      Cheers, Josh

      Reply
  3. Evelyn says:
    February 16, 2011 at 12:13 pm

    Hi Josh,

    I would love the text also. I also tried to copy/paste it and couldn’t…

    Thank you so much,
    Evelyn

    Reply
  4. Bernhard says:
    February 21, 2011 at 3:45 am

    Hi Josh,

    it would be nice, if you can send me the code via mail ;)

    Thanks a lot
    Bernhard

    Reply
  5. Joshu says:
    May 4, 2011 at 10:58 pm

    Dear all,

    Now I have disabled the copy block script, anyone can directly copy from here now.

    cheers
    Josh

    Reply
  6. Victoria says:
    August 15, 2011 at 4:22 am

    Hi Josh,
    This looks like a fantastic script, but I’m having trouble getting it to work….

    Is there something i’m missing? Is there anything I am supposed to change?

    I have added the codes exactly as is to my website header and updated the body tag…

    Thanks,

    Victoria

    Reply
  7. Stacey Abo says:
    September 26, 2011 at 10:13 pm

    It did work fine for me! Thanks for the great script and appreciate your help!

    regards
    Stacey

    Reply
  8. Tired of buying hundreds of thousands of hits to your blog and your Alexa ranking hardly moves? Get great traffic with Alexa Traffic Booster you can increase your Alexa ranking up to a whopping 50%. Using this incredible service will improve your large we says:
    October 5, 2011 at 12:45 pm

    Valuable info. Fortunate me I discovered your web site by accident, and I am surprised why this accident did not came about in advance! I bookmarked it.

    Reply
  9. Daniel says:
    October 6, 2011 at 12:52 am

    Hi Josh :)

    Thanks for the tutorial first of all! :)

    It works great with IE, but I can’t get it to work with Google Chrome.. it seems to have something to do with the onunload event.. do you know of any complications with this script and Google Chrome?

    Best regards,
    -Daniel

    Reply
    • Joshu says:
      October 6, 2011 at 11:25 pm

      Hey Dan,
      It seems like it works for IE and Mozilla only. But nowadays we have plugins for CMS that works, why dont you try that way?

      Regards
      Josh

      Reply
  10. Link bids Webdirectory says:
    December 20, 2011 at 7:56 pm

    I’m really inspired together with your writing skills and also with the format in your blog. Is that this a paid subject matter or did you modify it yourself? Either way keep up the nice high quality writing, it’s uncommon to see a nice blog like this one nowadays..

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

CAPTCHA Image
Refresh Image

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 Subscribe to OC Blog! 

Subscribe to OC Blog

Stay tuned to the Latest updates and tips in the Webmaster World




Most Popular Posts

  • List of High PR do follow blogs (Verified) (321)
  • Next Google Page rank - PR update 2011 (284)
  • Market Samurai Discount – Save 80 USD! (235)
  • 300 High paying adsense keywords 2011 (106)
  • List of High PR Dofollow Directories 2011 (95)
  • 22 OpenSource Forum Scripts - Details and Download: update list (82)
  • Best Classifieds Ads Scripts (77)
  • How to modify the Wordpress comment Form (67)
  • Review of the List of the Best Social Networking websites 2011 (61)
  • List of 200 Highest paying Adsense Keywords : Updated list 2010 (44)
  • Featured Interviews: Harsh Agarwal from ShoutMeLoud.com (44)
  • 10 Best Premium Wordpress Plugins (43)
  • Elegant Themes Discount 2011 (Save 10 USD) (42)
  • List of all Top Social Networking websites as on 2010 (38)
  • One of the Biggest SEO Secret for Linkbuilding (37)
  • 14 Best Ajax Scripts to use for any website (37)
  • Download KeywordLuv WordPress Plugin (37)
  • How i earn Big Bucks from my blog Doing Nothing! (37)
  • Fatal Error on WordPress 3.3 Version Upgrade (37)
  • 30 Best wordpress Plugins required for Any WP Blog (36)
About OrangeCopper Network 

Who am I? Am Joshu. I enjoy blogging about webmaster related stuff and technology. Xtras - I Design, Develop, Blog and Support the Open Source. Passions: I Love Music, Photography, Design, Development, Cycling, Travelling and sleeping (Favorite)

What i could do for you: Ive been working on various shades of the web for over 11 years now and learned the hard way, Now i could help you learn it the Easy way. OrangeCopper is a Webmaster community that i started in the year 2002 and is now a platform for webmasters around the world. Thankyou for spending your time to visit Blog. I would love to get connected every webmaster reading this, follow me on Twitter and i would auto follow you. Thanks again, Happy Surfing!

Interested to Learn Professional Blogging? Check out my NapIncome Blog where I share all the secrets to build a professional blog and earn money from ProBlogging.

Please Subscribe to the Blog Newsletter to get regular weekly update
Twitter: http://www.twitter.com/orangecopper | Subscribe to feeds : http://feeds.feedburner.com/orangecopper/ilRl

Other OrangeCopper Network Websites

ConnectRing Web Directory | UsedMobiles.in | UsedGadgets.in | NapIncome Strategy Blog | HippieMonk Technology Blog | All Good WordPress Themes | PixelTribes Photography Blog | Yscream Web Hosting

Favorite Articles

  • List Of Best Classifieds Ads Scripts Ever (Free & premium)
  • How to triple your Blog Subscription rates / opt-ins – It Worked for me!
  • You can certainly spend Half a Dollar For creating a GREAT Blog
  • How i earn Big Bucks from my blog Doing Nothing!
  • 35 best free wordpress themes for download: updated list 2010
  • 22 Web 2.0 Colors and their codes in HTML
  • 48+ web Design Related Twitter Accounts To Follow
  • Make a web 2 icon with Photoshop in easy 8 steps
  • List of 62 Free Press Release websites

    Most Rated Articles

  • Compare WordPress – Joomla – Drupal and their features
  • 7 Excellent jQuery menus and jQuery examples and downloads
  • 5 Most Important To Do s for a New Blog Launch
  • How to colorize with adobe Photoshop
  • Free Magento Themes / Templates Download: updated list
  • How to install wordpress step by step tutorial
  • List of 200 Highest paying Adsense Keywords : Updated list 2010
  • How to display Exit Splash or Exit message for website
  • How to promote your old Blog posts