標題背景圖像 第二個標題背景圖像 背景圖片
'); if ($.trim(selector) !== '') { var id = 'error_div_' + selector.replace('#', '').replace('.', '').replace(' ', ''); $error.attr('id', id); } $input.parent().append($error); } $error.html(msg).show(); $input.attr('aria-invalid', true).attr('aria-describedby', $error.attr('id')); if (! aria_live_shown) { aria_live_shown = true; $error.attr('aria-live', 'polite'); $input.focus(); } } } $(".signup_form_submit_btn").removeClass('disabled'); } else if (data.result === 3) { // Email is already being used, please Log In /* $("#nav .js-login").click(); // added #nav to log pageview once for desktop and mobile $("#login-email").val(email).show(); $("#login-pass").focus(); $("#login_error").html(data.msg).show(); resetRecaptcha('signup'); */ alertEx('email already used'); $(".signup_form_submit_btn").removeClass('disabled'); } /* else if (false && data.result === 14) { // for countreis like germany, needs email verification // directly go to next step if (signup_collectCardOnSignUp) { var postData = {action : 'submitSignupCCForm_save_card', payUrl:data.payUrl}; $('#signup_cc_iframe')[0].contentWindow.postMessage(JSON.stringify(postData), '*'); } else { signup_goto_next_step(); } //var message = "\u8acb\u9a57\u8b49\u60a8\u7684\u96fb\u5b50\u90f5\u4ef6\u3002"; //alertEx(message); //$(".signup_form_submit_btn").removeClass('disabled'); } */ else if (data.result > 0) { //signup_goto_next_step(); var j = get_next_step_index_by_step_id('signup_form'); $('.signup_stepicon_index_'+ (j-1)).addClass('done'); signup_goto_step(j); if (data.requiresEmailVerification == 1) { $('.done_header_div').addClass('email_verification').removeClass('no_email_verification'); $('.signup_stepicon_done .signup_stepicon_text ').html("\u8b1d\u8b1d"); } else { $('.done_header_div').addClass('no_email_verification').removeClass('email_verification'); $('.signup_stepicon_done .signup_stepicon_text').html("\u5b8c\u6210"); } $('.ifonly_pop_close_img').click(function(e){ var redirectUrl = $("#redirectURL").val().trim(); var url_regex = /^(http|https)/; if (url_regex.test(String(redirectUrl).toLowerCase())) { redirectUrl = ''; // do not allow redirect to other site } location.href = redirectUrl; }); signup_form_submitted(data); } else { if (data.error_code == 'sess_exp') { alertEx("\u6703\u8a71\u5df2\u904e\u671f\u3002\u9801\u9762\u5c07\u5237\u65b0\u3002"); window.setTimeout(function() { location.href = g_is_mobile ? '/m' : '/'; }, 5000); } else if (data.msg) { alert(data.msg); } else { alert('register error'); } } }).fail( function(xhr, textStatus, error) { if (g_thisHost === 'www') { location.reload(); } else if (g_thisHost==='dev' || g_thisHost==='test') { alert_error("Error in _streamlined_signup_form register
status:" + textStatus + "
error:" + error + "

" + xhr.responseText); } else { confirmEx("\u8acb\u5237\u65b0\u4e26\u91cd\u8a66\u3002" + ' ' + "\u5982\u679c\u60a8\u7e7c\u7e8c\u6536\u5230\u6b64\u932f\u8aa4\u8a0a\u606f\uff0c\u8acb\u806f\u7e6bpriceless\u2122\u79ae\u8cd3\u90e8" + '

It will automatically refresh the page in LIVE.
(' + textStatus + ' - ' + xhr.statusText + ')', 'User Signup Error', function(){location.reload();}, function(){loadingAnimation("hide");}, "\u5237\u65b0", "\u95dc\u9589"); console.log(xhr); } $(".signup_form_submit_btn").removeClass('disabled'); }); return false; } // data: data returned form register ajax call function signup_form_submitted(data){ console.log('signup form submitted successfully'); // adobe tracking 1.10 var adobeTracking = {ctaName: 'Sign up - Completed'}; if (g_withMcCompleteRegistrationForm) { adobeTracking['ctaName'] = 'Sign up Completed – Long Form'; } if (data.cardTypeName) { adobeTracking['cardType'] = data.cardTypeName; } adobeSatelliteTracking('Forms', adobeTracking); // Need to make callback since we NOW have emailAddress and userId // emailAddress and userId are needed for BlueShift if (typeof data !== 'undefined' && data.emailAddress && data.userId) { trackingSignupConfirmation(data.emailAddress, data.userId); } if (addGuestProductToCart()) return false; // if need to add a guest product (main.js) /* if (g_sourceId === 0 && g_register_result.result === 1) { // display thank you when it's new user g_signup_timer = 5000; // need more time to read message if (g_register_result.loginExistingUser) { g_signup_timer = 0; } else { var showEmailCrm = false; if (showEmailCrm && $('#pricelessProgram').prop('checked')) { g_signup_timer = 60 * 60 * 1000; // one hour show_ifonly_overlay('.email_crm_overlay'); $('.email_crm_overlay').attr('continu_signup_process', '1'); } else{ showThankYouPopIfNecessary(); } } } */ var redirectUrl = $("#redirectURL").val().trim(); var url_regex = /^(http|https)/; if (url_regex.test(String(redirectUrl).toLowerCase())) { redirectUrl = ''; // do not allow redirect to other site } /* g_signup_timer = 5000; if (g_register_result!==null && ! empty(g_register_result.terms)) { showMemberTermsAndPrivacyDialog(redirectUrl, g_register_result.terms, g_register_result.termsTranslatedText); return false; } else if (redirectUrl !== '' && redirectUrl !== '#') { setTimeout(function() { location.href = redirectUrl; }, g_signup_timer); } else { setTimeout(function() { location.reload(); }, g_signup_timer); } */ } function signup_syncCCIframeSize() { if ($('#signup_cc_iframe').length > 0) { var postData = {action : 'syncCCIframeSize'}; $('#signup_cc_iframe')[0].contentWindow.postMessage(JSON.stringify(postData), '*'); } } function resetCCform() { if ($('#signup_cc_iframe').length > 0) { var postData = {action: 'resetCCform'}; $('#signup_cc_iframe')[0].contentWindow.postMessage(JSON.stringify(postData), '*'); $('.signup_cc_submit_btn').removeClass('disabled'); } } function resetSignupForm() { g_signup_cc_saved = false; $('#redesignedSignupForm .error_div').hide(); $('#redesignedSignupForm input:not([type=hidden]), #redesignedSignupForm select').val(''); $('.signup_cc_submit_btn').removeClass('disabled'); $('.signup_form_submit_btn').removeClass('disabled'); $('.mc_priceless_check').prop('checked', false); } function resetStepIcon() { $('.signup_stepicon').removeClass('done').removeClass('current'); } // ************** listen to message from the iframe ************************ if (typeof(signup_redesign_js_loaded)=='undefined') { signup_redesign_js_loaded = true; window.addEventListener("message", function(e){ if (e.origin !== 'https://pay.priceless.com') return; try { var data = jQuery.parseJSON(e.data); } catch(err) { return; } if (data.action === 'signup_cc_saved') { console.log('signup_cc_saved received'); g_signup_cc_saved = true; //signup_goto_next_step(); var j = get_next_step_index_by_step_id('verify_card'); $('.signup_stepicon_index_'+ (j-1)).addClass('done'); signup_goto_step(j); } else if (data.action === 'signup_cc_save_called') { if (! g_signup_cc_saved) { $('.signup_cc_submit_btn').removeClass('disabled'); } $(".signup_form_submit_btn").removeClass('disabled'); } else if (data.action === 'alert_session_timeout') { alertEx("\u6703\u8a71\u5df2\u904e\u671f\u3002\u9801\u9762\u5c07\u5237\u65b0\u3002"); window.setTimeout(function() { location.href = g_is_mobile ? '/m' : '/'; }, 5000); } // event handlers else if (data.action === 'resize_signup_cc_iframe') { if (data.height) { var $target = $('#signup_cc_iframe'); if(data.target !== undefined && $.trim(data.target) !== '' && $.trim(data.target) !== '.' && $.trim(data.target) !== '#'){ $target = $(data.target); } //$target.attr('style', 'min-height: ' + data.height + 'px; max-height: ' + data.height + 'px;'); $target.css('min-height', data.height ); $target.css('height', data.height ); $target.css('max-height', 'none'); } } }); }