有时在互联网上,我看到一种对我来说很奇怪的语法.就像是:
console.log = console.error = console.info = console.debug = console.warn = console.trace = function() {}
Run Code Online (Sandbox Code Playgroud)
这个"平等"序列如何运作?
谢谢.
我的问题是当我添加一个:
.done(function() {
innerDef.resolve();
});
Run Code Online (Sandbox Code Playgroud)
在"动画"功能中,它不能按我的意愿工作.
我只是希望函数等到动画结束,如下所示:
$('#anim_vision').showThis().done(function(){
alert('task finished!');
});
Run Code Online (Sandbox Code Playgroud)
我的完整插件代码:
(function ($) {
$.fn.extend({
showThis: function (options) {
var def = $.Deferred();
var options = $.extend(options);
var deferredList = [];
this.each(function () {
var innerDef = $.Deferred();
deferredList.push(innerDef.promise());
$( this )
.children('.texto')
.removeClass('opacity_none')
.css('display','block');
$( this )
.animate({'height':'100%'}, 900, 'easeOutQuad')
.done(function() {
innerDef.resolve();
});
});
$.when.apply($, deferredList).done(function() {
def.resolve();
});
return def.promise();
}
});
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
我真的需要帮助!
我正在尝试将电子邮件订阅到PHP中的MailChimp列表。我实际上不是后端开发人员,所以我对此停滞不前:(
我正在使用MailChimp帮助程序PHP库:https : //github.com/drewm/mailchimp-api
我已经搜索了所有互联网,并且只能得到500个内部服务器错误的状态。我已经在生产服务器中。
<?php
include("./inc/MailChimp.php");
use \DrewM\MailChimp\MailChimp;
$api_key = "xxxxxxxxxxx-us13";
$list_id = "7xxxxxxx4";
$MailChimp = new MailChimp($api_key);
$result = $MailChimp->post("lists/$list_id/members", [
"email_address" => $_POST["txt_mail"],
'merge_fields' => ['FNAME'=>$_POST["txt_name"], 'FPHONE'=>$_POST["txt_phone"], 'FMSG'=>$_POST["txt_message"]],
"status" => "subscribed"
]);
if ($MailChimp->success()) {
echo "<h4>Thank you, you have been added to our mailing list.</h4>";
} else {
echo $MailChimp->getLastError();
} ?>
Run Code Online (Sandbox Code Playgroud)