Sunday Morning

1h ago

Sign up for the CBS 58Newsletter

<![CDATA[ var SUBMITTING_NEWSLETTER = false; $(document).ready(function(){ $('#newsletter_signup_form').submit( function(e){ e.preventDefault(); if(SUBMITTING_NEWSLETTER){ //console.log('I made it this far!'); return; } SUBMITTING_NEWSLETTER = true; var emailAddress = $('#email').val(); if(emailAddress.length <= 2){ if(WEBVIEW.SITE_NAME == 'telemundowi'){ alert("Email Inválido"); }else{ alert("Enter a valid email"); } return; } //var height = $('#newsletter_submit').height(); //$('#newsletter_submit i').remove(); //$('#newsletter_submit').append('‘); $.ajax({ url: ‘/ajax/newsletter_signup/’, data: { email: emailAddress }, type: ‘POST’, dataType: ‘json’, success: function(data) { if(data.status == “success”){ //recreate other div if(WEBVIEW.SITE_NAME == ‘telemundowi’){ $(‘.aside-newsletter-signup’).html(‘Gracias por suscribirte a nuestro boletín]]>’); } else { $(‘.aside-newsletter-signup’).html(‘Thank you for subscribing to our newsletter!’); } } else if(data.status == “failure”){ $(‘#newsletter_submit’).empty(); $(‘#newsletter_submit’).append(‘‘); alert(data.msg); } SUBMITTING_NEWSLETTER = false; }, error : function(response) { //console.log(‘Boohoo…’); //alert(‘Error’); console.log(response); } }); }); });

Trending

On CBS 58


  • as per our monitoring above Story originally appeared on

    * this Source → *

    14

    More at → all Story at a.

    By allaboutian

    the open online profile for all

    Leave a Reply

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