I’m using wordress and i wrote a small script to compare posts.
After i actived ssl it brokes my script.
I got this error in the developter consol.
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');
}
});
Change this line:
to this: