Javascript,
          l’assembleur du web ?



François Stephany
<div id="footercontainer">
  <div class="footercolumn">
    <h2>Contact us</h2>
    <p>
      If you have any questions, write us at:
      <span class="email">
        <a href="mailto:info@agilitic.com">info@agilitic.com</a>
      </span>
    </p>
    <p>
      <img alt="Phone-icon" src="/images/phone-icon.png"/>
      +32 496 21 33 79
    </p>
  </div>

  <div class="footercolumn footercolumn2">
    <h2>Informations</h2>
    <p>
      <strong>agilitic SCRL</strong><br />
      Rue Lecat 1 bte 4<br />
      7020 Nimy (Mons), Belgium<br />
      TVA BE 817 331 995
    </p>
  </div>
HTML
GET - POST


             Serveur

  HTML
Javascript
Ajax
$('#about_us');


$.get('/search/', params, function(data){
 $('#search_results').replaceWith(data);
 $('img.search_spinner').hide();
});
Yeah !
Solutions
Web Services
GET - POST


             Serveur

  JSON
   XML
{
    "firstName": "John",                 JSON
    "lastName": "Smith",
    "age": 25,
    "address": {
        "streetAddress": "21 2nd Street",
        "city": "New York",
        "state": "NY",
        "postalCode": "10021"
    },
    "phoneNumber": [
        { "type": "home", "number": "212 5551234" },
        { "type": "fax", "number": "646 555-4567" }
    ]
}
SproutCore
Google Web Toolkit
Cappuccino
@implementation PhotoCell : CPView
{
    CPImage         image;
    CPImageView     imageView;
    CPView          highlightView;
}

- (void)setRepresentedObject:(JSObject)anObject
{
    if(!imageView)
    {
        imageView = [[CPImageView alloc] initWithFrame:CGRectMakeCopy([self bounds])];
        [imageView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
        [imageView setImageScaling:CPScaleProportionally];
        [imageView setHasShadow:YES];
        [self addSubview:imageView];
    }

    [image setDelegate:nil];

    image = [[CPImage alloc] initWithContentsOfFile:thumbForFlickrPhoto(anObject)];

    [image setDelegate:self];

    if([image loadStatus] == CPImageLoadStatusCompleted)
        [imageView setImage:image];
    else
        [imageView setImage:nil];
}
http://agilitic.com
francois.stephany@agilitic.com
Femme: http://www.flickr.com/photos/glouk/4523649809/
Bébé: http://www.flickr.com/photos/collin_key/2981543442
Relais: http://www.flickr.com/photos/corpmjo/3486656862/
Spaghetti: http://www.flickr.com/photos/hanan/2204357625/
Jump: http://www.flickr.com/photos/eole/2342256254/
Café: http://www.flickr.com/photos/57908537@N00/4494131909/
Choux: http://www.flickr.com/photos/bachaboulou/92698416/
Plage: http://www.flickr.com/photos/htjems/2956672568/

Javascript l'assembleur du web ?

  • 1.
    Javascript, l’assembleur du web ? François Stephany
  • 2.
    <div id="footercontainer"> <div class="footercolumn"> <h2>Contact us</h2> <p> If you have any questions, write us at: <span class="email"> <a href="mailto:info@agilitic.com">info@agilitic.com</a> </span> </p> <p> <img alt="Phone-icon" src="/images/phone-icon.png"/> +32 496 21 33 79 </p> </div> <div class="footercolumn footercolumn2"> <h2>Informations</h2> <p> <strong>agilitic SCRL</strong><br /> Rue Lecat 1 bte 4<br /> 7020 Nimy (Mons), Belgium<br /> TVA BE 817 331 995 </p> </div>
  • 3.
  • 5.
    GET - POST Serveur HTML
  • 6.
  • 7.
  • 8.
    $('#about_us'); $.get('/search/', params, function(data){ $('#search_results').replaceWith(data); $('img.search_spinner').hide(); });
  • 9.
  • 10.
  • 13.
  • 14.
    GET - POST Serveur JSON XML
  • 15.
    { "firstName": "John", JSON "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021" }, "phoneNumber": [ { "type": "home", "number": "212 5551234" }, { "type": "fax", "number": "646 555-4567" } ] }
  • 16.
  • 18.
  • 20.
  • 21.
    @implementation PhotoCell :CPView { CPImage image; CPImageView imageView; CPView highlightView; } - (void)setRepresentedObject:(JSObject)anObject { if(!imageView) { imageView = [[CPImageView alloc] initWithFrame:CGRectMakeCopy([self bounds])]; [imageView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable]; [imageView setImageScaling:CPScaleProportionally]; [imageView setHasShadow:YES]; [self addSubview:imageView]; } [image setDelegate:nil]; image = [[CPImage alloc] initWithContentsOfFile:thumbForFlickrPhoto(anObject)]; [image setDelegate:self]; if([image loadStatus] == CPImageLoadStatusCompleted) [imageView setImage:image]; else [imageView setImage:nil]; }
  • 23.
  • 24.
    Femme: http://www.flickr.com/photos/glouk/4523649809/ Bébé: http://www.flickr.com/photos/collin_key/2981543442 Relais:http://www.flickr.com/photos/corpmjo/3486656862/ Spaghetti: http://www.flickr.com/photos/hanan/2204357625/ Jump: http://www.flickr.com/photos/eole/2342256254/ Café: http://www.flickr.com/photos/57908537@N00/4494131909/ Choux: http://www.flickr.com/photos/bachaboulou/92698416/ Plage: http://www.flickr.com/photos/htjems/2956672568/

Editor's Notes

  • #3  C&amp;#x2019;est quoi ? * HTML utilis&amp;#xE9; uniquement pour la pr&amp;#xE9;sentation * Pas de comportement * Vu comme un arbre XML
  • #5 OK pour des pages statiques
  • #7 * Manipulation du HTML avec du Javascript =&gt; Interaction * e.g., cacher un DIV, afficher une lightbox.
  • #8 JS Permet de faire des requ&amp;#xEA;tes asynchrones
  • #9 Ca fait quoi ?
  • #10 * Bataille d&amp;#x2019;IDS * Comportement difficile &amp;#xE0; identifier / cerner ? * HTML + JS + r&amp;#xE9;ponse serveur + CSS -&gt; Homogene ?
  • #11 * Paradigme existant pour des applications Desktop * Pourquoi se faire chier &amp;#xE0; &amp;#xE9;crire du HTML/JS &amp;#xE0; la main ? * Utiliser HTML 5 de mani&amp;#xE8;re totalement transparente
  • #12 * Delicious Library * hautement dynamique * int&amp;#xE9;gration webcam, redimensionnement &amp;#xE0; la vol&amp;#xE9;e, actions instantan&amp;#xE9;es
  • #13 * Thunderbird * Client mail
  • #14 * O&amp;#xF9; stocker les donn&amp;#xE9;es ? * Web Services (JSON) * RPC (Google web toolkit) * Stockage local (HTML 5)
  • #17 * Reste du JS * Plus comme un framework MVC * Assez proche du web. * Maintenant avec un Interface builder (GreenHouse)
  • #18 * MobileMe -&gt; Synchronisation Apple
  • #19 * Google Wave * GMail * ...
  • #20 * Code en java * G&amp;#xE9;n&amp;#xE8;re du JS * Debug enti&amp;#xE8;rement en Java * RPC Java pour communication FrontEnd / Backend
  • #21 * Plus d&amp;#x2019;URLs * Indexation google nick&amp;#xE9;e * Uniquement pour des applications, pas des sites
  • #22 * Objective-J * Cocoa * D&amp;#xE9;mo du truc ou on peut dessiner son salon
  • #24 Les trois noms ?