【发布时间】:2016-05-01 16:01:01
【问题描述】:
我正在使用 wordress,我写了一个小脚本来比较帖子。 在我激活 ssl 后,它破坏了我的脚本。
我在开发者控制台中遇到了这个错误。
Uncaught SyntaxError: Unexpected token <
jQuery.ajax({
type: "POST",
url: "<?php echo admin_url('admin-ajax.php') ?>",
data: {
action: 'compare',
post_id: $(checkbox).val(),
_ajax_nonce: '<?php echo wp_create_nonce('compare'); ?>'
},
success: function(html){
html = $.parseJSON(html);
console.log('success');
$('#count').fadeIn(200);
$('#count').html(html.length);
},
error: function(html){
console.log('error');
}
});
【问题讨论】: