Line | |
---|
1 | var 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 | |
---|
24 | function handleError() |
---|
25 | { |
---|
26 | alert("Error Ajax"); |
---|
27 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.