-
-
Save brandonhilkert/eaee9aa9ef01004e22fc to your computer and use it in GitHub Desktop.
Revisions
-
pjrvs revised this gist
May 10, 2014 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,9 @@ if (location.href.match(/utm\_source\=mailchimp/)){ // where you use url.com?utm_source=mailchimp from within your campaigns $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); var newSearch = location.search.replace(/utm_.*?(&|$)/g,""), newSearch = newSearch.length > 1 ? newSearch : ""; newSearch != location.search && window.history.replaceState({},'', location.href.replace(location.search, newSearch)); } if ($.cookie('subscriberCookie')) { -
pjrvs revised this gist
May 10, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,9 +7,9 @@ <body> <form action="XXX" method="post" class="signup"> <input type="text" placeholder="Your Name..." name="FNAME" id="XXX"> <input type="email" placeholder="Your Email..." name="EMAIL" id="XXX"> <button type="submit" class="set">GO</button> </form> -
pjrvs revised this gist
May 10, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ $(".set").on("click", function () { // where a user subscribes from the form on your site $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); }); -
pjrvs revised this gist
May 10, 2014 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,11 +21,13 @@ <script> $(".set").on("click", function () { // where the button has a class of "set" $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); }); if (location.href.match(/utm\_source\=mailchimp/)){ // where you use url.com?utm_source=mailchimp from within your campaigns $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); } -
pjrvs created this gist
May 10, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ <!DOCTYPE html> <html> <head> <title>jQuery Cookie + MailChimp</title> <meta charset="utf-8"> </head> <body> <form action="http://pjrvs.us6.list-manage.com/subscribe/post?u=26857d08cfc91db6993e0bfc4&id=3f954190de" method="post" class="signup"> <input type="text" placeholder="Your Name..." name="FNAME" id="mce-FNAME"> <input type="text" placeholder="Your Email..." name="EMAIL" id="mce-EMAIL"> <button type="submit" class="set">GO</button> </form> <div class="subbed">You've already signed up, <a href="#">check this out</a> instead.</div> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script> $(".set").on("click", function () { // where the button has a class of "set" $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); }); if (location.href.match(/utm\_source\=mailchimp/)){ // where you use url.com?utm_source=mailchimp $.cookie('subscriberCookie', 'subbed', { expires: 99999 }); } if ($.cookie('subscriberCookie')) { $('.signup').hide(); $(".subbed").show(); } else { $('.signup').show(); $('.subbed').hide(); } </script> </body> </html>