gpt4 book ai didi

javascript - 修复 Mailchimp 选择加入功能 - 从测试到生产

转载 作者:行者123 更新时间:2023-11-28 01:05:00 31 4
gpt4 key购买 nike

我在选择加入 mailchimp 的测试状态版本并将其应用到我的网站(建立在 weebly 平台上)时遇到了巨大的麻烦。

我的目标:在 Weebly 上创建自定义 Mailchimp 选择加入表单。

问题:选择加入的测试版本(本地托管)在生产版本(weebly 平台)上完全失败。

我认为一个库或另一个库正在被覆盖。也许是 mailchimp CDN,但不确定。

使用的库:

  • 自举
  • FontAwesome
  • Mailchimp CDN

我正在使用代码嵌入片段工具将它添加到我的 weebly 网站。这可能为功能增加了另一层复杂性。

这是我的选择加入表单代码:

<!-- FontAwesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<!-- Begin MailChimp Signup Form -->
<link href="http://cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<style type="text/css">
#mc_embed_signup {
background:#283184;
color: white;
clear:left;
font:19px Helvetica,Arial,sans-serif;
width: 800px;
padding: 20px;
border-radius: 15px;
}
.btn {
background-color: #339bff;
color: white;
margin-top: 10px;
}
.label {
font: 28px;
}
.asterisk {
color: red;
}
</style>
<!-- container Body -->
<div id="mc_embed_signup" class="container">
<form action="https://silverlinkfunding.us17.list-manage.com/subscribe/post?u=459fcc96e094a6b4dbe3e69f8&amp;id=4afd1b9608" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<div id="mc_embed_signup_scroll">
<h2 class="text-center"><b>Apply Now</b></h2>
<div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<!-- Name Row -->
<div class="row form-group">
<div class="col-sm-6 mc-field-group">
<div class="row">
<div class="col-sm-12">
<label for="mce-FNAME">First Name<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-FNAME" name="FNAME" aria-describedby="firstName" placeholder="Enter First Name">
</div>
</div>
</div>
<div class="col-sm-6 mc-field-group">
<div class="row">
<div class="col-sm-12">
<label for="mce-LNAME">Last Name<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-LNAME" name="LNAME" aria-describedby="lastName" placeholder="Enter Last Name">
</div>
</div>
</div>
</div>
<!-- Email Row -->
<div class="row form-group">
<div class="col-sm-12 mc-field-group">
<div class="row">
<div class="col-sm-12">
<label for="mce-EMAIL"><i class="fas fa-envelope"></i> Email Address<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-EMAIL" name="EMAIL" aria-describedby="email" placeholder="YourEmail@Domain.com">
</div>
</div>
</div>
</div>
<!-- Phone Row -->
<div class="row form-group">
<div class="col-sm-12 mc-field-group">
<div class="row">
<div class="col-sm-12">
<label for="mce-MMERGE3"><i class="fas fa-phone"></i> Phone <span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" name="MMERGE3" id="mce-MMERGE3" aria-describedby="phone" placeholder="(xxx) xxx-xxxx">
</div>
</div>
</div>
</div>
<!-- Business, City, State Row -->
<div class="row form-group">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-6 mc-field-group">
<label for="mce-MMERGE4"><i class="fas fa-briefcase"></i> Business Name<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-MMERGE4" name="MMERGE4" aria-describedby="businessname" placeholder="My Businesss LLC">
</div>
<div class="col-sm-4 mc-field-group">
<label for="mce-MMERGE5"><i class="fas fa-city"></i> City<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-MMERGE5" name="MMERGE5" aria-describedby="city" placeholder="Enter City Name">
</div>
<div class="col-sm-2 mc-field-group">
<label for="mce-MMERGE9"><i class="fas fa-map-pin"></i> State<span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" id="mce-MMERGE9" name="MMERGE9" aria-describedby="state" placeholder="">
</div>
</div>
</div>
</div>
<!-- Phone Row -->
<div class="row form-group">
<div class="col-sm-12">
<div class="row">
<div class="col-sm-6 mc-field-group">
<label for="mce-MMERGE7">Loan Amount Requested <span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" name="MMERGE7" class="required" id="mce-MMERGE7" placeholder="$xx,xxx">
</div>
<div class="col-sm-6 mc-field-group">
<label for="mce-MMERGE8">Cash Available For Investment <span class="asterisk">*</span>
</label>
<input type="text" class="form-control required" value="" name="MMERGE8" class="required" id="mce-MMERGE8" placeholder="$xx,xxx">
</div>
</div>
</div>
</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_459fcc96e094a6b4dbe3e69f8_4afd1b9608" tabindex="-1" value=""></div>
<div class="clear d-flex justify-content-center"><input type="submit" value="Apply Now" name="subscribe" id="mc-embedded-subscribe" class="button btn" onclick="window.open('https://www.silverlinkfunding.com/thank-you-application.html')"></div>
</div>
</form>
</div>
<script type='text/javascript' src='http://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[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';fnames[0]='EMAIL';ftypes[0]='email';fnames[3]='MMERGE3';ftypes[3]='phone';fnames[4]='MMERGE4';ftypes[4]='text';fnames[7]='MMERGE7';ftypes[7]='text';fnames[8]='MMERGE8';ftypes[8]='text';fnames[5]='MMERGE5';ftypes[5]='text';fnames[9]='MMERGE9';ftypes[9]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
<!--End mc_embed_signup-->

测试状态(在本地机器上):

  • 表单验证有效 - 停留在页面点击并提醒各种表单不符合验证的窗口。
  • 表单成功选择加入 mailchimp
  • 表单重定向到/thank-you-application 页面

生产状态(托管在 weebly 上):

  • 表单验证失败

  • 表单验证不会停止重定向到感谢页面

  • 几个 fontawesome 图标失效

选择加入表单的当前实时版本:https://www.silverlinkfunding.com/color-me-mine.html

我的问题:

  • 库是否被覆盖?
  • Something on weebly 覆盖了一切吗?
  • 我是不是编码错了?
  • 我是否错误地调用了 CDN 或库?

非常感谢您的帮助!

最佳答案

在您的控制台中,您应该能够看到如下所示的四个警告:

[blocked] The page at https://www.silverlinkfunding.com/color-me-mine.html was not allowed to run insecure content from http://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js.

也许您可以尝试通过 https 加载这些文件,看看是否可以解决有关 MailChimp 的问题。

关于javascript - 修复 Mailchimp 选择加入功能 - 从测试到生产,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52431294/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com