I have a very interesting problem that I can't solve. If I click "Done" more than six times in a row, Express.js stops displaying results after the sixth result, so I can't see more than six results in my console. If I refresh the page, the same thing happens again.
What's causing this?
index.jade
html
head
link(rel="stylesheet" href="stylesheets/bootstrap.css")
body
.container
.row
.col-md-10
table.table.table-striped
thead
tr
th Title
th Channel
th Video
th Done
tbody
for m in mi
tr.test
td.videourl #{m.video_url}
td #{m.video_title}
td #{m.channel_name}
td
a(href="https://www.youtube.com/watch?v=#{m.video_url}") Watch
td
button.btn.btn-success(type='button') Done
script(src="https://code.jquery.com/jquery-3.0.0-alpha1.js")
script(src="javascripts/frontend/bootstrap/bootstrap.js")
script(src="javascripts/youtube.js")
jQuery
$('.btn-success').click(function() {
$(this).parent().parent().fadeOut(1);
var url = $(this).parent().parent().find('.videourl').text();
console.log(url); // there is no problem here, I can see every url in Chrome console.
$.post(
"/form2", {
url: url
},
function(data) {
console.log("success");
});
});
app.js
app.post('/form2', function(req, res) {
var url = req.body.url;
console.log(url);
});