html
<span><a class="like-Unlike" href="">Like</a></span>
my.js
$(".like-Unlike").on('click',function (e) {
        if ($(this).html() == "Like") {
            $(this).html('Unlike');
        }
        else {
            $(this).html('Like');
        }
        return false;
    }
);
Problem is : the Like button doesn't work as a toggle button without error message, but after I return all the above javascript into console, it works.
 
     
     
    