1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Great JavaScript For Coupon Marketing

Discussion in 'HTML & JavaScript' started by BlackBat, May 9, 2009.

  1. BlackBat

    BlackBat Newbie

    Joined:
    Jan 6, 2008
    Messages:
    34
    Likes Received:
    4
    Code:
    meancoupons.com/hostgator/
    Check out the "Activate coupon" links :cool:

    Very cool way to stuff IMO.

    The only question I have is - can any javascript genius extract the whole code that makes this work?

    I was unable to find externally included .js on that page that usually does it.
     
  2. gimme4free

    gimme4free Executive VIP Jr. VIP Premium Member

    Joined:
    Oct 22, 2008
    Messages:
    1,921
    Likes Received:
    1,941
    Home Page:
    Have this in an external js :
    Code:
    OpenWindow=window.open("", "newwin", "height=350, width=450,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Use this Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");OpenWindow.document.write("Enter This Coupon Code At Checkout:");OpenWindow.document.write("<p>");OpenWindow.document.write("<strong>");OpenWindow.document.write(couponcode);OpenWindow.document.write("<\/strong>");OpenWindow.document.write("<\/p>");OpenWindow.document.write("<strong>");
    OpenWindow.document.write("Restrictions: ");OpenWindow.document.write("<\/strong>");OpenWindow.document.write(restrictions);OpenWindow.document.write("<p>");
    OpenWindow.document.write("<\/p>");OpenWindow.document.write("<br>");OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<\/BODY>");
    OpenWindow.document.write("<\/HTML>");OpenWindow.document.close();OpenWindow.focus();}if (couponcode == 'coupon' || couponcode == 'n/a'){OpenWindow=window.open("", "newwin", "height=350, width=450,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Use this Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");
    OpenWindow.document.write("Coupon Code Automatically Applied During Checkout");OpenWindow.document.write("<br>");OpenWindow.document.write("<br>");OpenWindow.document.write("<strong>");	OpenWindow.document.write("Restrictions: ");OpenWindow.document.write("<\/strong>");OpenWindow.document.write(restrictions);
    OpenWindow.document.write("<p>");OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<\/BODY>");OpenWindow.document.write("<\/HTML>");
    OpenWindow.document.close();OpenWindow.focus();}}function displaycoupon(param2){var couponcode = param2;if (couponcode != 'coupon' && couponcode != 'n/a')
    {OpenWindow=window.open("", "newwin", "height=150, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Use this Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");OpenWindow.document.write("Enter This Coupon Code At Checkout:");OpenWindow.document.write("<p>");OpenWindow.document.write("<strong>");OpenWindow.document.write(couponcode);OpenWindow.document.write("<\/strong>");OpenWindow.document.write("<\/p>");OpenWindow.document.write("<br>");
    OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<\/BODY>");OpenWindow.document.write("<\/HTML>");OpenWindow.document.close();
    OpenWindow.focus();}if (couponcode == 'coupon' || couponcode == 'n/a'){OpenWindow=window.open("", "newwin", "height=150, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");OpenWindow.document.write("Coupon Code Automatically Applied During Checkout:");OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<\/BODY>");OpenWindow.document.write("<\/HTML>");OpenWindow.document.close();OpenWindow.focus();}}function trackcoupon(param2){var couponcode = param2;if (couponcode != 'coupon' && couponcode != 'n/a'){OpenWindow=window.open("", "newwin", "height=150, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Use this Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");
    OpenWindow.document.write("Enter This Coupon Code At Checkout:");OpenWindow.document.write("<p>");OpenWindow.document.write("<strong>");OpenWindow.document.write(couponcode);OpenWindow.document.write("<\/strong>");OpenWindow.document.write("<\/p>");OpenWindow.document.write("<br>");OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<script>");OpenWindow.document.write("if(typeof(urchinTracker)!='function')document.write('<sc'+'ript src=\"'+");
    OpenWindow.document.write("'http'+(document.location.protocol=='https:'?'s:\/\/ssl':':\/\/www')+");OpenWindow.document.write("'.google-analytics.com\/urchin.js'+'\"><\/sc'+'ript>')");OpenWindow.document.write("<\/script>");OpenWindow.document.write("<script>");OpenWindow.document.write("  _uacct = 'UA-2048363-2';");OpenWindow.document.write("  urchinTracker(\"\/2041938978\/goal\");");OpenWindow.document.write("<\/script>");OpenWindow.document.write("<\/BODY>");OpenWindow.document.write("<\/HTML>");OpenWindow.document.close();OpenWindow.focus();}if (couponcode == 'coupon' || couponcode == 'n/a'){
    OpenWindow=window.open("", "newwin", "height=150, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");OpenWindow.document.write("<TITLE>Coupon Code<\/TITLE>");OpenWindow.document.write("<BODY BGCOLOR=#ffffcc>");OpenWindow.document.write("<table><tr><td style='border: 2px dashed #808080'>");OpenWindow.document.write("<center>");OpenWindow.document.write("Coupon Code Automatically Applied During Checkout:");OpenWindow.document.write("<\/td><\/tr><\/table>");OpenWindow.document.write("<\/BODY>");OpenWindow.document.write("<\/HTML>");OpenWindow.document.close();OpenWindow.focus();}}function displaytext(yourtext){window.status=yourtext;
      }
    Link to js on the page:
    Code:
    <script language="javascript" src="js.js" type="text/javascript"></script>
    And this as your Link:
    Code:
    <a href="http://www.affiliatelink.com/" onKeyPress="displaycoupon('cheaphosting')" onClick="displaycoupon('cheaphosting')" onMouseOver="displaytext('Get the coupon'); return true;"  onMouseOut="displaytext(''); return true;">Tex To Display Here</a>
     
    • Thanks Thanks x 1
  3. BlackBat

    BlackBat Newbie

    Joined:
    Jan 6, 2008
    Messages:
    34
    Likes Received:
    4
    Thanks for complete code gimme4free!
     
  4. jackfitz

    jackfitz Newbie

    Joined:
    May 2, 2009
    Messages:
    27
    Likes Received:
    1
    hum... How Do i implement this in to a new site?