Posted by wiifm on June 2, 2010 at 8:40pm
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
- Development status: Under active development
- Module categories: Statistics
- Maintenance status: Unknown
- Reported installs: 37 sites currently report using this module. View usage statistics.
- Last modified: July 7, 2011