AlloyUI - Working with Ajax

aui-io-request를 사용한다

AUI().use('aui-io-request', function (A) {
 // OUR CODE wil run here
});

CODE sample

A.io.request('test.html');
A.io.request('test.html', {
    method: 'POST',
    data: {
        key1: 'value'
    }
});

5 possible callbacks : start, complete, success, failure, end

A.io.request('test.html', {
    on: {
        success: function() {
            alert(this.get('responseData'));
        }
    }
});

JSON format responseData

A.io.request('test.html', {
    dataType: 'json',
    on: {
        success: function() {
            alert(this.get('responseData').myProperty);
        }
    }
});

http:\/\/alloyui.com\/api\/ 참고

results matching ""

    No results matching ""