Statistics_ajax in action

Description:

This module provides a way to programmatically update the {node_counter} table (provided by the core statistics module).

This module listens to a URL in the format of '/statistics/ajax/[nid]' where [nid] is the id of the node you are looking to update the statistics for.

Alternatives to this module:

Boost has a statistics component to the module, so if you are already using boost, you do not need this module. Statistics_ajax is a extremely lightweight module, and would be great if you did not want to deploy boost to your site, and still have node statistics updated through AJAX.

Installation:

Sample code:

Sample javascript code (using jQuery):

// TODO, remove the hardcoded nid
var nid = 52;
// fire AJAX
$.ajax({
url: "/statistics/ajax/" + nid,
type: "POST",
dataTypeString: "text"
});

Sample response:

The response is return in the JSON format:

Example success message:

{ "status": "success", "data": "node updated" }

Example error message:

{ "status": "error", "data": "POST is not allowed" }

Project Information

Downloads

Version Downloads Date Links
7.x-1.1 tar.gz (8.61 KB) | zip (10.15 KB) 2011-Jul-07 Notes
6.x-1.0 tar.gz (8.43 KB) | zip (10.27 KB) 2010-Jun-04 Notes

Maintainers for Statistics AJAX

  • wiifm - 4 commits
    last: 31 weeks ago, first: 1 year ago

Issues for Statistics AJAX

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Oldest open issue: 27 Jun 10
nobody click here