A Drupal javascript library for loading nodes and comments.
PHP JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
jsonify.info
jsonify.js
jsonify.module

README.md

Usage

Drupal.behaviors.myBehavior = function() {
  // Retrieve a node synchronously
  var node = Drupal.jsonify.load('node', 1);
  console.log(node);
  
  // Retrieve a node asynchronously
  var node = Drupal.jsonify.load('node', 1, function(node) {
    console.log(node);
  });
  
  // Retrieve a comment synchronously
  var comment = Drupal.jsonify.load('comment', 1);
  console.log(comment);
  
  // Retrieve a comment asynchronously
  var comment = Drupal.jsonify.load('comment', 1, function(comment) {
    console.log(comment);
  });
};