Special offer expiry date with a twist

Simply follow the short instructions below and before you know it you’ll have an active deadline date counting down the days until your offer expires.

So where’s the twist?

What’s extra special about this unique code is as soon as the offer is over the HTML code you placed inside this script will no longer be seen on your website.

For example inside the HTML code could be an order button giving your visitors the chance to order at a discount. As soon as the special offer date has been reached the discount order button just disappears!

Here’s how it all works…

There are two peices of code you’ll need to include in your web page before this will work for you.

A. Select all of the code in the box below then copy to clipboard (Ctrl+c) then paste (Ctrl+v) it above the </head> tag of your HTML source code.

B. Select all of the text in the second box below then copy to clipboard (Ctrl+c), then paste (Ctrl+v) the HTML code you’ve just selected into the source code of your web page anywhere between the <body> and </body> tags. The position you choose is where your special offer will appear.

C. You need to place your special offer HTML-code between tags
<div id="specialOffer">
<iframe width="1" height="1" frameborder="0"
  marginheight="0" marginwidth="0" scrolling="no">

and

</iframe>
</div>

D. Set the offer ID-string and expiry date you need at string
expiration("specialOffer", 2009, 12, 31);
Note. See the comment below this string.

Appendix: You can place the expiry date inside your special offer with the #expiryDate# variable. Or/And you can place the number of days till the offer expire with the #expiryDays# variable.

 

That’s all there is to it, you can see below how it should look when you’ve installed it on your web page.

Sample for the code:
<div id="specialOffer">
<iframe width="1" height="1" frameborder="0"
  marginheight="0" marginwidth="0" scrolling="no">

<div><b>Your special offer HTML-code.</b></div>
<div>You can use:</div>
<div>still <i>#expiryDays# days</i></div>
<div>or till <i>#expiryDate#</i></div>

</iframe>The offer has expired. Sorry.
</div>
<script language="JavaScript" type="text/javascript">
<!--
expiration("specialOffer", 2009, 12, 31);
//expiration(offerID, year, month, day);
//-->
</script>

The offer has expired. Sorry.
 

Sample for the code:
<div id="specialOffer">
<iframe width="1" height="1" frameborder="0"
  marginheight="0" marginwidth="0" scrolling="no">

<div><b>Your special offer HTML-code.</b></div>
<div>You can use:</div>
<div>still <i>#expiryDays# days</i></div>
<div>or till <i>#expiryDate#</i></div>

</iframe>The offer has expired. Sorry.
</div>
<script language="JavaScript" type="text/javascript">
<!--
expiration("specialOffer", 2005, 12, 31);
//expiration(offerID, year, month, day);
//-->
</script>

The offer has expired. Sorry.
by Michel Komarov, © Copyright 2004. iCoder.com

 

Share in social bookmarking:These icons link to social bookmarking sites where readers can share and discover new web pages.  digg del.icio.us BlinkList Reddit NewsVine YahooMyWeb co.mments

Related Articles:

Got a question?   Leave a Reply

You must be logged in to post a comment.