source: ether_2012/trunk/web/resources/js/Request.js @ 330

Last change on this file since 330 was 330, checked in by vmipsl, 12 years ago

Import du projet Ether pour le nouveau look 2012

File size: 630 bytes
Line 
1var Request = Request || {
2    send: function( params )
3    {
4        new Ajax.Request(params.url,
5        {
6            method:      'post',
7            encoding:    'UTF-8',
8            contentType: 'application/x-www-form-urlencoded',
9            parameters:  params.parameters,
10            onSuccess:   params.onSuccess,
11            onFailure:   params.onFailure || handleError,
12            onComplete:  params.onComplete,
13            evalJSON:    'force'
14        });
15    },
16
17    translate: function( response )
18    {
19        return response.responseText.evalJSON();
20    }
21
22};
23
24function handleError()
25{
26        alert("Error Ajax");
27}
Note: See TracBrowser for help on using the repository browser.