2017-10-18 79 views
0

我試圖在wordpress網站中嵌入註冊表單。我做的是這樣的:我去了該頁面的WordPress的編輯器,並選擇添加原始html代碼的選項。然後粘貼下面的代碼:Mailchimp嵌入代碼不能在wordpress中工作

<!-- Begin MailChimp Signup Form --> 
<link href="//cdn-images.mailchimp.com/embedcode/slim-10_7.css" rel="stylesheet" type="text/css"> 
<style type="text/css"> 
#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; } 
/* Add your own MailChimp form style overrides in your site stylesheet or in this style block. 
We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */ 
</style> 
<div id="mc_embed_signup"> 
<form action="https://luisaspagnolistanford.us3.list-manage.com/subscribe/post?u=3b43aec3c5c107948b570c43d&amp;id=b67bd69928" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate> 
    <div id="mc_embed_signup_scroll"> 
     <label for="mce-EMAIL">Get notified about events and sales</label> 
     <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required> 
     <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--> 
     <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_3b43aec3c5c107948b570c43d_b67bd69928" tabindex="-1" value=""></div> 
     <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div> 
    </div> 
</form> 
</div> 

<!--End mc_embed_signup--> 

然後設計來罰款,我可以看到所有的代碼是有從檢查的鉻元素選項,但點擊時提交按鈕,它沒有做任何事情,也沒有錯誤。我只是想知道這裏有什麼問題。

回答

0

target="_blank"這意味着表單響應會在新選項卡中打開。尋找標籤。

您的core-scripts.js文件中有一個腳本阻止默認行爲。去掉它。

$("#mc-embedded-subscribe-form").submit(function(e){ 
    var $this = $(this); 

    e.preventDefault(); 
+0

不幸的是,沒有彈出窗口或新標籤。請點擊這裏[鏈接](http://luisaspagnolistanford.com/) –