|
| 1 | +<div id="mc_embed_signup"> |
| 2 | + <form |
| 3 | + action="https://twitter.us14.list-manage.com/subscribe/post?u=75419c71fe0a935e53dfa4a3f&id=91d0dccd39" |
| 4 | + method="post" |
| 5 | + id="mc-embedded-subscribe-form" |
| 6 | + name="mc-embedded-subscribe-form" |
| 7 | + class="email-subscribe-form validate deep-learning-form" |
| 8 | + target="_blank"> |
| 9 | + <div id="mc_embed_signup_scroll" class="email-subscribe-form-fields-wrapper"> |
| 10 | + <div class="mc-field-group"> |
| 11 | + <label for="mce-EMAIL" style="display:none;">Email Address</label> |
| 12 | + <input type="email" value="" name="EMAIL" class="required email deep-learning-input" id="mce-EMAIL" placeholder="Enter Your Email"> |
| 13 | + </div> |
| 14 | + |
| 15 | + <div id="mce-responses" class="clear"> |
| 16 | + <div class="response" id="mce-error-response" style="display:none"></div> |
| 17 | + <div class="response" id="mce-success-response" style="display:none"><a href="{{ site.baseurl}}/deep-learning-with-pytorch-thank-you" target="_blank"></a></div> |
| 18 | + </div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--> |
| 19 | + |
| 20 | + <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_75419c71fe0a935e53dfa4a3f_91d0dccd39" tabindex="-1" value=""></div> |
| 21 | + <button id="deep-learning-button" class="btn btn-lg with-right-arrow module-button email-subscribe-button">Download Book</button> |
| 22 | + </div> |
| 23 | + </form> |
| 24 | +</div> |
| 25 | + |
| 26 | +<script src="//cdn.jsdelivr.net/gh/cferdinandi/bouncer@1.0.5/dist/bouncer.polyfills.min.js"></script> |
| 27 | +<script type='text/javascript'> |
| 28 | + var bouncer = new Bouncer("#mc-embedded-subscribe-form", { |
| 29 | + // Don't automatically submit the form if it's verified |
| 30 | + disableSubmit: true |
| 31 | + }); |
| 32 | + document.addEventListener( |
| 33 | + "bouncerFormValid", |
| 34 | + function(event) { |
| 35 | + var $form = $(event.target); |
| 36 | + var $button = $form.find(".email-subscribe-button"); |
| 37 | + |
| 38 | + $.ajax({ |
| 39 | + type: "GET", |
| 40 | + url: |
| 41 | + "https://twitter.us14.list-manage.com/subscribe/post-json?u=75419c71fe0a935e53dfa4a3f&id=91d0dccd39&c=?", |
| 42 | + data: $form.serialize(), |
| 43 | + dataType: "json", |
| 44 | + contentType: "application/json; charset=utf-8", |
| 45 | + success: function(data) { |
| 46 | + if (data.result == "success") { |
| 47 | + window.location.href = |
| 48 | + "{{site.baseurl}}/deep-learning-with-pytorch-thank-you"; |
| 49 | + } else { |
| 50 | + if (data.msg.includes("is already subscribed to list")) { |
| 51 | + window.location.href = |
| 52 | + "{{site.baseurl}}/deep-learning-with-pytorch-thank-you"; |
| 53 | + } else { |
| 54 | + $form |
| 55 | + .find("#mce-error-response") |
| 56 | + .html("There was an error submitting the form. Please try again.") |
| 57 | + .show(); |
| 58 | + } |
| 59 | + } |
| 60 | + }, |
| 61 | + error: function(e) { |
| 62 | + window.location.href = |
| 63 | + "https://twitter.us14.list-manage.com/subscribe/post-json?u=75419c71fe0a935e53dfa4a3f&id=91d0dccd39&c=?"; |
| 64 | + } |
| 65 | + }); |
| 66 | + }, |
| 67 | + false |
| 68 | + ); |
| 69 | +</script> |
0 commit comments