User modern let to declare a variable.
parent
6306fdbbfc
commit
c264400794
|
@ -1,12 +1,12 @@
|
||||||
function familiar(index) {
|
function familiar(index) {
|
||||||
var username = $("#username").text();
|
let username = $("#username").text();
|
||||||
var word = $("#word_" + index).text();
|
let word = $("#word_" + index).text();
|
||||||
var freq = $("#freq_" + index).text();
|
let freq = $("#freq_" + index).text();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"get",
|
type:"get",
|
||||||
url:"/" + username + "/" + word + "/familiar",
|
url:"/" + username + "/" + word + "/familiar",
|
||||||
success:function(resp){
|
success:function(resp){
|
||||||
var new_freq = freq - 1;
|
let new_freq = freq - 1;
|
||||||
if(new_freq <1) {
|
if(new_freq <1) {
|
||||||
$("#p_" + index).remove();
|
$("#p_" + index).remove();
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,22 +17,22 @@ function familiar(index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function unfamiliar(index) {
|
function unfamiliar(index) {
|
||||||
var username = $("#username").text();
|
let username = $("#username").text();
|
||||||
var word = $("#word_" + index).text();
|
let word = $("#word_" + index).text();
|
||||||
var freq = $("#freq_" + index).text();
|
let freq = $("#freq_" + index).text();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"get",
|
type:"get",
|
||||||
url:"/" + username + "/" + word + "/unfamiliar",
|
url:"/" + username + "/" + word + "/unfamiliar",
|
||||||
success:function(resp){
|
success:function(resp){
|
||||||
var new_freq = parseInt(freq) + 1;
|
let new_freq = parseInt(freq) + 1;
|
||||||
$("#freq_" + index).text(new_freq);
|
$("#freq_" + index).text(new_freq);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function del_word(index) {
|
function del_word(index) {
|
||||||
var username = $("#username").text();
|
let username = $("#username").text();
|
||||||
var word = $("#word_" + index).text();
|
let word = $("#word_" + index).text();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"get",
|
type:"get",
|
||||||
url:"/" + username + "/" + word + "/del",
|
url:"/" + username + "/" + word + "/del",
|
||||||
|
@ -40,4 +40,4 @@ function del_word(index) {
|
||||||
$("#p_" + index).remove();
|
$("#p_" + index).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue