1

是写语法吗?在参数部分我想添加这个字段以发送到服务器但不工作

 Ext.Ajax.request({

                url:'http://localhost:8084/org.servlet/url_servlet',
                method:'GET',


 params:{

        myname:document.getElementById('firstname').value//this is the field i want to send to the servlet

    } ,  
              success: function (response){
            Ext.Msg.alert('Succesfully added ');

     },
          failure: function (){
           Ext.Msg.alert('Error in server');
    }
4

1 回答 1

1

你可以用ajax来做

示例代码

Ext.Ajax.request({
    url: 'page.php',
    params: {
        id: 1
    },
    success: function(response){
        var text = response.responseText;
        // process server response here
    }
});
于 2012-12-27T15:04:31.567 回答