Question
JQuery & Javascript: I need to make a simple blog html page that will let me add and delete a post containing name, comment, and
JQuery & Javascript: I need to make a simple blog html page that will let me add and delete a post containing name, comment, and date the comment was made using the js moment library found in [ https://momentjs.com/downloads/moment.js ]. This is what I have so far.. I'm having a bit of trouble with the subtree. Comments would be appreciated, thanks! //******************************** post.html ******************************//
My Fake Blog
Post About Thing
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
This is a wall of text. This is a wall of text. This is a wall of text.
class="card-header">Add a comment
etomai
This is my comment. I think the post is too long.
//******************************** comment.js ******************************//
$("#comment_submit_button").click(function()
{
comment_name = $("#comment_name").val();
comment_text = $("#comment_text").val();
comment_date = moment().format("l");
if(!/^[a-zA-Z0-9]+/.test(comment_name))
{
comment_name = "Error_User-Violation"
}
if(!comment_text.trim())
{
comment_text = "Error_Text_Violation"
}
comment_template = $("#test").clone();
comment_template.find("#comment_board-userName").text(comment_name).append( " " + comment_date);
comment_template.find("#comment_board-userText").text(comment_text);
comment_template.insertBefore("#test");
return false //equals like system("pause") in c++
})
$(document).on('click', '.delete_btn' , function()
{
console.log("hu")
$(this).find("#test").remove();
console.log("nothing happen")
})
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started