aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/comments/api/frontends/count-link/getcommentcount.js
blob: 536824c736ffd3d6369da412011cff68c3dee9ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Send AJAX request to backend for a comment count (getcommentcount.js)
HashOverCountLink.prototype.getCommentCount = function (link, options)
{
	// Reference to this HashOver object
	var hashover = this;

	// Get backend queries
	var queries = ['url=' + options.url];

	// Backend request path
	var requestPath = '/countlinkajax';

	// Handle backend request
	this.ajax ('POST', requestPath, queries, function (json) {
		if (json['link-text'] !== undefined) {
			link.textContent = json['link-text'];
		}
	}, true);
};