mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
16 lines
No EOL
392 B
JavaScript
16 lines
No EOL
392 B
JavaScript
var Comment = function(eventId, csrfToken) {
|
|
this.eventId = eventId
|
|
this.csrfToken = csrfToken
|
|
}
|
|
|
|
Comment.prototype.create = function(form) {
|
|
var self = this
|
|
var form = $(form)
|
|
var comment = form.find('[name="comment"]').val()
|
|
form.remove()
|
|
|
|
$.post('/event/'+this.eventId+'/comment', {csrf_token: this.csrfToken, comment: comment}, function(res) {
|
|
console.log(res)
|
|
})
|
|
|
|
} |