| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 
 |   /* ajouté un méthode au démarrage */
  document.onLoad.push(function() {
    alert(1);
  });
  /* créer la page */
  document.Html(
    {
      lang:'fr',
      xmlns:'http://www.w3.org/1999/xhtml',
      'xml:lang':'fr'
    },null,
    {
      foo: function() {
        alert(this.nodeName + ': ' + this.clientWidth + ' X ' + this.clientHeight);
      }
    })
    .Head({'xmlns:x':'urn:org.truc.nc'})
      .Title('Test de page  DOM').parentNode.parentNode
    .Body(null,{backgroundColor: 'rgb(128,0,0)'})
      .H1('Hello',null,{margin:'auto', width:'150px', textAlign:'center', backgroundColor: 'rgb(255,255,255)'}).parentNode
      .P({
        'class':'corpus',
        id:'150',
        title:'corps',
        lang:'fr',
        'xml:lang':'fr',
        dir:'rtl'
      },{
        margin:'auto',
        padding:'15px',
        width:'90%',
        height:document.body.clientHeight - 100,
        textAlign:'left',
        backgroundColor: 'rgb(255,255,255)'
      },{
        onclick: function() {
          document.html.foo();
        }
      }).B('World');
 
  /* ajouter de niuveau une autre methode au démarage */
  document.onLoad.push(function() {
    document.body.style.backgroundColor = 'rgb(0,128,255)';
  });
  /* ajouter dynamiquement du contenu dans l'élément d'id 150 */
  document.getElementById('150').Br().Text('Somme text').Br()
  .AHref('sample.js', 'view code', {target:'_source'}) | 
Partager