This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Basic - hello who?
The first example is about replacing the HTML ‘Hello World’ below by ‘Hello Mary’.
The word ‘Mary’ is coming from a JSON.
The HTML:
<div id="hello">
Hello <span class="who">World</span>
</div>
The JSON data:
var json = { "who": "Mary" }
The Javascript to do this action (here with jQuery):
$('#hello').autoRender( json );
Note:
The notations below are also possible with different results:
- Replacing ‘target’ by ‘hello’ transformed by the json
$('#target').autoRender(json, $('#hello')); - Replacing the content of a target (its innerHTML)
$('#target').html( $p.autoRender( $('#hello')[0], json)); - The same as above, but with a classical Javascript syntax:
var target = document.getElementById('target1'); var html = document.getElementById('hello'); var json = { "who": "Mary" }; target.innerHTML = $p.autoRender( html, json );






