dojo.io.bind



dojo.io.bind({
        timeoutSeconds: 3000,
        url:'server.jsp',//定义请求的地址
        method:'post',//发送的方法 post get
        handler:helloCallback,//定义回调函数,服务器相应后执行的函数
        content:{name:dojo.byId('name').value}//发送请求参数
        });
        
        }

url: Ajax send address request

method: Send the request of the way, get or post

handler: callback function specified when the server response upon completion of the automatically activated

content: is a javascript object, the object composed by a group of property, the property is required to send the request

Parameters

Other parameters:

sync: whether to use synchronous, default false

timeoutSeconds: timeout time, if set to 0, then do not consider overtime Forever

timeout: specify the server to respond to overtime callback function when the trigger

load: the server to respond to normal when the callback function to trigger.

error: server response error when the trigger callback function.

The first three can be combined to the handler



Callback function of the parameters:

type: the type of response error error

data: data transmission

 function helloCallback(type,data,evt){
        if(type=='error'){
            alert('该服务器读取数据出错');}
        else{
            dojo.byId('show').innerHTML=data;
          }
        }