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 ******************************//

JavaScript Comment Board

class="container">

class="pb-2 mt-4 mb-2 border-bottom">

My Fake Blog

class="row col-md-8 col-md-offset-2">

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 w-100">

class="card-header">Add a comment

class="card-body">

class="form-group">

class="form-control" placeholder="Name"/>

class="form-group">

class="form-group">

class="card w-100 mt-3">

class="card-header">

class="row">

class="col-md-11">

etomai

class="col-md-1">

class="card-body">

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!