Code

Changes between Version 8 and Version 9 of KSSInDjango


Ignore:
Timestamp:
10/16/07 00:18:47 (7 years ago)
Author:
msaelices
Comment:

go out with some wiki words

Legend:

Unmodified
Added
Removed
Modified
  • KSSInDjango

    v8 v9  
    5151}}} 
    5252 
    53 The lines above mean that if the user clicks on a link element like ``<span class="page-link"><a href="wiki/view?title=WikiWord">WikiWord</a></span>``, KSS will execute the previous fragment (like CSS selector does) and will: 
     53The lines above mean that if the user clicks on a link element like {{{<span class="page-link"><a href="wiki/view?title=WikiWord">WikiWord</a></span>}}}, KSS will execute the previous fragment (like CSS selector does) and will: 
    5454 1. Override ``href`` argument, and send an AJAX request to URL defined in ``action-server`` KSS attribute. In this case the link goes to ``ajax/view``, but without refreshing the page. 
    55  1. Pass a HTTP parameter (``POST`` by default) named ``title`` (as defined in ``ajax/view-title``) with the value taken from the content of the node (``WikiWord`` in this case). In this case it is like ``ajax/view?title=WikiWord`` request, but in a ``POST`` method. 
     55 1. Pass a HTTP parameter (``POST`` by default) named ``title`` (as defined in ``ajax/view-title``) with the value taken from the content of the node (``!WikiWord`` in this case). In this case it is like {{{ajax/view?title=WikiWord}}} request, but in a ``POST`` method. 
    5656 1. The server action takes the AJAX request and returns KSS commands to the browser. Commands are XML fragments that do things like (I explain better later): 
    5757   * ''replace breadcrumbs with ``Home / News / Foo News item``'' 
     
    5959   * ''replace main content with the new content i am seeing'' 
    6060 
    61 The first step is very important for accesibility. If you have javascript disabled and the users clicks he would go to ``wiki/view?title=WikiWord``, and it works perfectly both with or without javascript. 
     61The first step is very important for accesibility. If you have javascript disabled and the users clicks he would go to {{{wiki/view?title=WikiWord}}}, and it works perfectly both with or without javascript. 
    6262 
    6363The last thing to explain is how to send KSS commands from '''server side'''. Normal code at server side (i.e. a django view) could be something like this: