OGeek|极客世界-中国程序员成长平台

标题: android - 如何将 Mailchimp 与 Ionic 应用程序集成? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:36
标题: android - 如何将 Mailchimp 与 Ionic 应用程序集成?

我正在制作一个 Ionic 应用程序,我正在尝试集成 mailchimp。我正在使用嵌入式表单,只要我在浏览器上运行它( ionic 服务)它们就可以工作,但是每当我在 native 设备上测试时它就不起作用。有人知道怎么做这个吗?谢谢。

<!-- Begin MailChimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-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>


<!--<label class="item item-input">
  <span class="input-label">Email</span>
  <input type="email">
</label>-->
<div id="mc_embed_signup">
<form action="//[businessname].[dc].list-manage.com/subscribe/post?u=[list]&amp;id=39c3c32163" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
    <h3 class="padding">Don’t Miss Out on the Top Stories from Each Week!</h3>
<div class="mc-field-group">
    <label for="mce-EMAIL" class="item item-input">
    <span class="input-label">Email Address: </span>
    <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL">
  </label>
</div>
<div class="mc-field-group" >
    <label for="mce-FNAME" class="item item-input">
    <span class="input-label">First Name: </span>
    <input type="text" value="" name="FNAME" class="" id="mce-FNAME">
  </label>
</div>
<div class="mc-field-group" >
    <label for="mce-LNAME" class="item item-input">
    <span class="input-label">Last Name: </span>
    <input type="text" value="" name="LNAME" class="" id="mce-LNAME">
  </label>
</div>
<div class="mc-field-group" >
    <label for="mce-MMERGE9" class="item item-input">
    <span class="input-label">State: </span>
    <input type="text" value="" name="MMERGE9" class="" id="mce-MMERGE9">
  </label>
</div>
    <div id="mce-responses" class="clear">
        <div class="response" id="mce-error-response" style="display:none"></div>
        <div class="response" id="mce-success-response" style="display:none"></div>
    </div>    <!-- 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_1b57193ff878b1601ed47f497_39c3c32163" tabindex="-1" value=""></div>
    <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button button-positive button-block"></div>
    </div>
</form>
</div>
<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>
<script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[9]='MMERGE9';ftypes[9]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup-->



Best Answer-推荐答案


您需要更改两行。将#form 添加到表单标签和 (click)="form.submit()"到输入标签:

<form #form action="//[businessname].[dc].list-manage.com/subscribe/post?u=[list]&amp;id=39c3c32163" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button button-positive button-block" (click)="form.submit()">

关于android - 如何将 Mailchimp 与 Ionic 应用程序集成?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41710599/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) Powered by Discuz! X3.4