Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Unified inconsistency of words "mynode" and "myName" to "myNode", using first appeared words "my node" and the capitalized coding style.

...

We used jQuery to create a node named "mynodemyNode" below "content", with a property "oneProperty" and value "oneValue".

Code Block
JavaScript
JavaScript
$.post(
  "/content/*",
  {
    ':nameHint': 'myNamemyNode',
    oneProperty: 'oneValue'
  },
  function(data){
    alert(data);
  }
);

...

  • "/content/*" as url, using SlingPostServlet to create a new jcr node under the /content node
  • ':nameHint': "mynodemyNode", oneProperty: 'oneValue' is a key:pair list of request parameters.
    • ':nameHint' is a command (starts with ':') that tells Sling to use "mynodemyNode" for the node name.
    • oneProperty: sets one property under mynode myNode
  • the third (optional) parameter is a callback

...