I have this script:
<script>
$(document).ready(function () {
$("#changeResumeStatus").click(function () {
$.get("{% url 'main:changeResumeStatus' %}", function (data) {
if (data['message'] == 'hidden') {
$("#resumeStatus").text("скрыто");
} else {
$("#resumeStatus").text("опубликовано");
}
}, "json");
});
});
</script>
I receive the following error in my Google Chrome console:
event.returnValue is deprecated. Please use the standard event.preventDefault() instead.
I am using jQuery v1.10.2 and #changeResumeStatus
is a <span>
.
What's wrong with my script?
.empty().append("text")
is better expressed as.text("text")
. – Walworth