Changeset 18123 in project


Ignore:
Timestamp:
05/21/10 12:07:45 (9 years ago)
Author:
Mario Domenech Goulart
Message:

awful (trunk): added content-type' keyword parameter to ajax',
periodical-ajax' and ajax-link'. Default is
'application/x-www-form-urlencoded'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/awful/trunk/awful.scm

    r18116 r18123  
    378378;;; Ajax
    379379(define (ajax path id event proc #!key target (action 'html) (method 'POST) (arguments '())
    380               js no-session no-db no-page-javascript vhost-root-path live)
     380              js no-session no-db no-page-javascript vhost-root-path live
     381              (content-type 'application/x-www-form-urlencoded))
    381382  (if (enable-ajax)
    382383      (let ((path (if (regexp? path)
     
    416417                       "function(){$.ajax({type:'" (->string method) "',"
    417418                       "url:'" path "',"
     419                       "contentType: '" (->string content-type) "',"
    418420                       "success:function(h){"
    419421                       (or js
     
    437439
    438440(define (periodical-ajax path interval proc #!key target (action 'html) (method 'POST)
    439                          (arguments '()) js no-session no-db vhost-root-path live)
     441                         (arguments '()) js no-session no-db vhost-root-path live
     442                         (content-type 'application/x-www-form-urlencoded))
    440443  (if (enable-ajax)
    441444      (page-javascript
     
    451454                 vhost-root-path: vhost-root-path
    452455                 live: live
     456                 content-type: content-type
    453457                 no-page-javascript: #t)
    454458           ", " (->string interval) ");\n"))
     
    457461(define (ajax-link path id text proc #!key target (action 'html) (method 'POST) (arguments '())
    458462                   js no-session no-db (event 'click) vhost-root-path live class
    459                    hreflang type rel rev charset coords shape accesskey tabindex a-target)
     463                   hreflang type rel rev charset coords shape accesskey tabindex a-target
     464                   (content-type 'application/x-www-form-urlencoded))
    460465  (ajax path id event proc
    461466        target: target
     
    467472        vhost-root-path: vhost-root-path
    468473        live: live
     474        content-type: content-type
    469475        no-db: no-db)
    470476  (<a> href: "#"
Note: See TracChangeset for help on using the changeset viewer.