天天看點

EXT Ajax送出

1.

2.

3. Ext.Ajax.request({

4. //請求位址

5. url: 'login.do',

6. //送出參數組

7. params: {

8. LoginName:Ext.get('LoginName').dom.value,

9. LoginPassword:Ext.get('LoginPassword').dom.value

10. },

11. //成功時回調

12. success: function(response, options) {

13. //擷取響應的json字元串

14. var responseArray = Ext.util.JSON.decode(response.responseText);

15. if(responseArray.success==true){

16. Ext.Msg.alert('恭喜','您已成功登入!');

17. }

18. else{

19. Ext.Msg.alert('失敗','登入失敗,請重新登入');

20. }

21. }

22. });

本文來自: 腳本之家(www.jb51.net) 詳細出處參考:http://www.jb51.net/article/15425.htm