Тема: javascript кто разберается подскажите
В общем ситуация такая. Использую email рассылку стандартную в движке. Хочу ее разместить на главной в отдельном блоке. При нажатии подписаться скрип копирует весь блок и выводит его. Подскажите кто разбирается, что где подправить.
javascript:
/**
* Подписка на рассылку
*/
$(function() {
$("body").on('submit', '#signUpUpdate form', function(){
var $_this = $("#signUpUpdate");
var data = $(this).serialize();
$.ajax({
type : 'POST',
url : $(this).attr('action'),
data : data,
dataType : 'json',
success : function(response){
$_this.replaceWith(response.html);
}
});
return false;
});
});
Шаблон:
{addjs file="../../moduleview/emailsubscribe/js/button.js"}
<div class="footer_box">
<div class="follow">
<div class="logo"><a href="/"><img src="/templates/test-1/resource/img/vaporstorelogo_white.png" width="100" height="100" alt="big" style="display: block;"></a></div>
<div class="text">
<p>ПРИСОЕДИНЯЙТЕСЬ К НАМ<span>в соцсетях и на email рассылку</span><span>чтобы не пропустить скидки, акции и новинки</span></p>
</div>
</div>
<div id="signUpUpdate" class="footer-signup-wrapper">
{if $success}
<div class="formSuccessText">
{$success}
</div>
{else}
<div class="title">{t}{/t}</div>
<form class="footer-signup-form formStyle" action="{$router->getUrl('emailsubscribe-block-subscribebutton')}" method="POST">
{$this_controller->myBlockIdInput()}
{if $errors}
{foreach $errors as $error}
<div class="error">
{$error}
</div>
{/foreach}
{/if}
<input class="nametitle" type="text" name="email" placeholder="e-mail"/>
{if $CONFIG.enable_agreement_personal_data}
{include file="%site%/policy/agreement_phrase.tpl" button_title="{t}Подписаться{/t}"}
{/if}
<div class="row buttonsLine">
<button class="buttonmy" type="submit">{t}Подписаться{/t}</button>
</div>
</form>
{/if}
</div>
{if $CONFIG.facebook_group || $CONFIG.vkontakte_group || $CONFIG.twitter_group || $CONFIG.instagram_group}
<div class="social-link">
{if $CONFIG.facebook_group}
<li class="item s-fb">
<a href="{$CONFIG.facebook_group}" target="_blank" class="facebook">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="96.124px" height="96.123px" viewBox="0 0 96.124 96.123" style="enable-background:new 0 0 96.124 96.123;" xml:space="preserve">
<g>
<path d="M72.089,0.02L59.624,0C45.62,0,36.57,9.285,36.57,23.656v10.907H24.037c-1.083,0-1.96,0.878-1.96,1.961v15.803
c0,1.083,0.878,1.96,1.96,1.96h12.533v39.876c0,1.083,0.877,1.96,1.96,1.96h16.352c1.083,0,1.96-0.878,1.96-1.96V54.287h14.654
c1.083,0,1.96-0.877,1.96-1.96l0.006-15.803c0-0.52-0.207-1.018-0.574-1.386c-0.367-0.368-0.867-0.575-1.387-0.575H56.842v-9.246
c0-4.444,1.059-6.7,6.848-6.7l8.397-0.003c1.082,0,1.959-0.878,1.959-1.96V1.98C74.046,0.899,73.17,0.022,72.089,0.02z"></path>
</g>
</svg>
</a>
</li>
{/if}
{if $CONFIG.vkontakte_group}
<li class="item s-vk">
<a href="{$CONFIG.vkontakte_group}" target="_blank" class="vk">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="548.358px" height="548.358px" viewBox="0 0 548.358 548.358" style="enable-background:new 0 0 548.358 548.358;" xml:space="preserve">
<g>
<path d="M545.451,400.298c-0.664-1.431-1.283-2.618-1.858-3.569c-9.514-17.135-27.695-38.167-54.532-63.102l-0.567-0.571
l-0.284-0.28l-0.287-0.287h-0.288c-12.18-11.611-19.893-19.418-23.123-23.415c-5.91-7.614-7.234-15.321-4.004-23.13
c2.282-5.9,10.854-18.36,25.696-37.397c7.807-10.089,13.99-18.175,18.556-24.267c32.931-43.78,47.208-71.756,42.828-83.939
l-1.701-2.847c-1.143-1.714-4.093-3.282-8.846-4.712c-4.764-1.427-10.853-1.663-18.278-0.712l-82.224,0.568
c-1.332-0.472-3.234-0.428-5.712,0.144c-2.475,0.572-3.713,0.859-3.713,0.859l-1.431,0.715l-1.136,0.859
c-0.952,0.568-1.999,1.567-3.142,2.995c-1.137,1.423-2.088,3.093-2.848,4.996c-8.952,23.031-19.13,44.444-30.553,64.238
c-7.043,11.803-13.511,22.032-19.418,30.693c-5.899,8.658-10.848,15.037-14.842,19.126c-4,4.093-7.61,7.372-10.852,9.849
c-3.237,2.478-5.708,3.525-7.419,3.142c-1.715-0.383-3.33-0.763-4.859-1.143c-2.663-1.714-4.805-4.045-6.42-6.995
c-1.622-2.95-2.714-6.663-3.285-11.136c-0.568-4.476-0.904-8.326-1-11.563c-0.089-3.233-0.048-7.806,0.145-13.706
c0.198-5.903,0.287-9.897,0.287-11.991c0-7.234,0.141-15.085,0.424-23.555c0.288-8.47,0.521-15.181,0.716-20.125
c0.194-4.949,0.284-10.185,0.284-15.705s-0.336-9.849-1-12.991c-0.656-3.138-1.663-6.184-2.99-9.137
c-1.335-2.95-3.289-5.232-5.853-6.852c-2.569-1.618-5.763-2.902-9.564-3.856c-10.089-2.283-22.936-3.518-38.547-3.71
c-35.401-0.38-58.148,1.906-68.236,6.855c-3.997,2.091-7.614,4.948-10.848,8.562c-3.427,4.189-3.905,6.475-1.431,6.851
c11.422,1.711,19.508,5.804,24.267,12.275l1.715,3.429c1.334,2.474,2.666,6.854,3.999,13.134c1.331,6.28,2.19,13.227,2.568,20.837
c0.95,13.897,0.95,25.793,0,35.689c-0.953,9.9-1.853,17.607-2.712,23.127c-0.859,5.52-2.143,9.993-3.855,13.418
c-1.715,3.426-2.856,5.52-3.428,6.28c-0.571,0.76-1.047,1.239-1.425,1.427c-2.474,0.948-5.047,1.431-7.71,1.431
c-2.667,0-5.901-1.334-9.707-4c-3.805-2.666-7.754-6.328-11.847-10.992c-4.093-4.665-8.709-11.184-13.85-19.558
c-5.137-8.374-10.467-18.271-15.987-29.691l-4.567-8.282c-2.855-5.328-6.755-13.086-11.704-23.267
c-4.952-10.185-9.329-20.037-13.134-29.554c-1.521-3.997-3.806-7.04-6.851-9.134l-1.429-0.859c-0.95-0.76-2.475-1.567-4.567-2.427
c-2.095-0.859-4.281-1.475-6.567-1.854l-78.229,0.568c-7.994,0-13.418,1.811-16.274,5.428l-1.143,1.711
C0.288,140.146,0,141.668,0,143.763c0,2.094,0.571,4.664,1.714,7.707c11.42,26.84,23.839,52.725,37.257,77.659
c13.418,24.934,25.078,45.019,34.973,60.237c9.897,15.229,19.985,29.602,30.264,43.112c10.279,13.515,17.083,22.176,20.412,25.981
c3.333,3.812,5.951,6.662,7.854,8.565l7.139,6.851c4.568,4.569,11.276,10.041,20.127,16.416
c8.853,6.379,18.654,12.659,29.408,18.85c10.756,6.181,23.269,11.225,37.546,15.126c14.275,3.905,28.169,5.472,41.684,4.716h32.834
c6.659-0.575,11.704-2.669,15.133-6.283l1.136-1.431c0.764-1.136,1.479-2.901,2.139-5.276c0.668-2.379,1-5,1-7.851
c-0.195-8.183,0.428-15.558,1.852-22.124c1.423-6.564,3.045-11.513,4.859-14.846c1.813-3.33,3.859-6.14,6.136-8.418
c2.282-2.283,3.908-3.666,4.862-4.142c0.948-0.479,1.705-0.804,2.276-0.999c4.568-1.522,9.944-0.048,16.136,4.429
c6.187,4.473,11.99,9.996,17.418,16.56c5.425,6.57,11.943,13.941,19.555,22.124c7.617,8.186,14.277,14.271,19.985,18.274
l5.708,3.426c3.812,2.286,8.761,4.38,14.853,6.283c6.081,1.902,11.409,2.378,15.984,1.427l73.087-1.14
c7.229,0,12.854-1.197,16.844-3.572c3.998-2.379,6.373-5,7.139-7.851c0.764-2.854,0.805-6.092,0.145-9.712
C546.782,404.25,546.115,401.725,545.451,400.298z"></path>
</g>
</svg>
</a>
</li>
{/if}
{if $CONFIG.twitter_group}
<li class="item s-tw">
<a href="{$CONFIG.twitter_group}" target="_blank" class="twitter">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="90px" height="90px" viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve">
<g>
<path id="Twitter" d="M67.261,67.496H45.054c-3.087,0-5.712-1.08-7.869-3.25c-2.167-2.172-3.238-4.797-3.238-7.898v-7.904H65.59
c2.854,0,5.312-1.025,7.354-3.062c2.041-2.054,3.066-4.509,3.066-7.366c0-2.867-1.025-5.319-3.072-7.366
c-2.049-2.042-4.515-3.066-7.381-3.066H33.946V11.254c0-3.09-1.102-5.735-3.29-7.939C28.478,1.107,25.842,0,22.782,0
c-3.146,0-5.825,1.091-8.004,3.25C12.591,5.416,11.5,8.084,11.5,11.264v45.089c0,9.274,3.278,17.197,9.837,23.773
C27.901,86.715,35.814,90,45.066,90h22.203c3.082,0,5.729-1.107,7.93-3.314c2.203-2.197,3.302-4.849,3.302-7.936
c0-3.088-1.099-5.734-3.302-7.941C72.997,68.607,70.347,67.496,67.261,67.496z"></path>
</g>
</svg>
</a>
</li>
{/if}
{if $CONFIG.instagram_group}
<li class="item s-in">
<a href="{$CONFIG.instagram_group}" target="_blank" class="instagram">
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="438.536px" height="438.536px" viewBox="0 0 438.536 438.536" style="enable-background:new 0 0 438.536 438.536;" xml:space="preserve">
<g>
<path d="M421.981,16.562C410.941,5.519,397.711,0,382.298,0H56.248C40.83,0,27.604,5.521,16.561,16.562
C5.52,27.6,0.001,40.828,0.001,56.243V382.29c0,15.413,5.518,28.644,16.56,39.683c11.043,11.04,24.272,16.563,39.687,16.563
h326.046c15.41,0,28.644-5.523,39.684-16.563c11.043-11.039,16.557-24.27,16.557-39.683V56.243
C438.534,40.825,433.021,27.604,421.981,16.562z M157.462,158.025c17.224-16.652,37.924-24.982,62.097-24.982
c24.36,0,45.153,8.33,62.381,24.982c17.228,16.655,25.837,36.785,25.837,60.386c0,23.598-8.609,43.729-25.837,60.379
c-17.228,16.659-38.014,24.988-62.381,24.988c-24.172,0-44.87-8.336-62.097-24.988c-17.228-16.652-25.841-36.781-25.841-60.379
C131.621,194.81,140.234,174.681,157.462,158.025z M388.865,370.589c0,4.945-1.718,9.083-5.141,12.416
c-3.433,3.33-7.519,4.996-12.282,4.996h-305.2c-4.948,0-9.091-1.666-12.419-4.996c-3.333-3.326-4.998-7.471-4.998-12.416V185.575
H89.08c-3.805,11.993-5.708,24.462-5.708,37.402c0,36.553,13.322,67.715,39.969,93.511c26.65,25.786,58.721,38.685,96.217,38.685
c24.744,0,47.583-5.903,68.527-17.703c20.937-11.807,37.486-27.839,49.676-48.112c12.183-20.272,18.274-42.4,18.274-66.38
c0-12.94-1.91-25.406-5.715-37.402h38.547v185.014H388.865z M388.865,115.626c0,5.52-1.903,10.184-5.716,13.99
c-3.805,3.809-8.466,5.711-13.989,5.711h-49.676c-5.517,0-10.185-1.903-13.99-5.711c-3.806-3.806-5.708-8.47-5.708-13.99V68.522
c0-5.33,1.902-9.945,5.708-13.848c3.806-3.901,8.474-5.854,13.99-5.854h49.676c5.523,0,10.185,1.952,13.989,5.854
c3.812,3.903,5.716,8.518,5.716,13.848V115.626z"></path>
</g>
</svg>
</a>
</li>
{/if}
</div>
{/if}
</div>
Скрины вывода:
https://yadi.sk/i/ye8iMkXB3Q4MAF
https://yadi.sk/i/phNCMJxU3Q4MBG
Мне нужно чтобы только выводилась надпись оповещение (На Ваш E-mail отправлено письмо с дальнейшей инструкцией для подтверждения подписки). Дальше я ее уже размещу где нужно.
Подскажите кто может.