以下是Wordpress中使用的Mailchimp短代码: 这是代码→
<div class="email-button-one-line">
<input type="text" name="email" id="email-<?php echo $random?>" value="" class="field-email-oneline" placeholder="<?php _e('Your Email Address', 'charito');?>"/><input type="submit" class="button field-email-button" name="mailchimp_submit" id="mailchimp_submit-<?php echo $random?>" value="<?php _e("Subscribe", 'charito');?>" />
<div class="clearfix"></div>
</div>
<script>
jQuery.noConflict();
jQuery(document).ready(function()
{
jQuery('#mailchimp_submit-<?php echo $random?>').click(function()
{
jQuery('#process-<?php echo $random?>').css('display','block');
var datastring = '&name=' + escape(jQuery('#name-<?php echo $random?>').val()) + '&email=' + escape(jQuery('#email-<?php echo $random?>').val()) + '&api_key=<?php echo get_theme_mod('blogeto_mailchimp_api_key');?>&list_id=<?php echo get_theme_mod('blogeto_mailchimp_list_id');?>';
jQuery.ajax({
url: '<?php echo rest_url('/mc/rest/pchimp/');?>',
data: datastring,
success: function(msg)
{
jQuery('#process-<?php echo $random?>').css('display','none');
jQuery('#newsletter_msg-<?php echo $random?>').html(msg);
},
error: function(msg)
{
jQuery('#process-<?php echo $random?>').css('display','none');
jQuery('#newsletter_msg-<?php echo $random?>').html(msg);
}
});
return false;
});
});
</script>
此代码部分是一个需要讨论的问题:
<input type="submit" class="button field-email-button" name="mailchimp_submit" id="mailchimp_submit-<?php echo $random?>" value="<?php _e("Subscribe", 'charito');?>" />
我希望将此更改为按钮,但只要我这样做→
<button type="submit" class="button field-email-button" name="mailchimp_submit" id="mailchimp_submit-<?php echo $random?>" value="<?php _e("Subscribe", 'charito');?>" /> <i class="fa fa-envelope" aria-hidden="true"> </i> Subscribe </button>
它停止工作。
你可能会说为什么按钮?
button
<i class="fa fa-envelope" aria-hidden="true"> </i> Subscribe
<input>
中无法使用input
当我将button
更改为stock_price = { 'AAPL' : [100,200,100.3,100.55,200.33],
'GOOGL': [100.03,200.11,230.33,100.20],
'SSNLF': [100.22,150.22,300,200,100.23],
'MSFT' : [100.89,200,100,500,200.11,600]}
def maximum(*args):
for column in args:
yield max(list(zip(*stock_price.values()))[column])
print(list(maximum(0, 1)))
时,为什么它不起作用,修复是什么?