文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>dojo.io.bind使用详解

dojo.io.bind使用详解

时间:2007-07-30  来源:linxh

本文转自: http://www.5icom.net/Html/Devlop/Ajax/94115.html  

访问一个纯文本资源:

dojo.io.bind({
    url: "http://foo.bar.com/sampleData.txt",
    load: function(type, data, evt){ /*do something w/ the data */ },
    error: function(type, error){ /*do something w/ the error*/ },
    mimetype: "text/plain"
});

加载一段

dojo.io.bind({
    url: "http://foo.bar.com/sampleData.js",
    load: function(type, evaldObj){ /* do something */ },
    mimetype: "text/javas cript"
});

提交Form:

dojo.io.bind({
    url: "http://foo.bar.com/processForm.cgi",
    load: function(type, evaldObj){ /* do something */ },
    formNode: dojo.byId("formToSubmit")
});

参数:

url:

the location of the resource being requested

mimetype:

Mimetype used to interpret the contents of the response with. Defaults to "text/plain". This does not set an outgoing mime header for HTTP transports.

method:

Format to use whem making the request. For HTTP transports this us usually either of "GET" or "POST" although non-HTTP transports may define and accept others. Defaults to "GET".

content:

An key/value mapping of properties to be constructed into paramaters passed with the data request. In HTTP transports, these are equivalent to query string paramaters or form fields in POST requests. The exact behavior of content-specified paramaters is dependent upon the transport in use.

transport:

String that explicitly specifies the transport object to use for the request. If the specified transport is not available, the request will not be made and the error callback will be fired.

changeUrl:

Boolean, defaults to false. Determines whether or not the request should be made "bookmarkable". This may be removed in the future as it pertains exclusively to in-browser HTTP transports.

formNode:

DOM Node that specifies a form to be serialized and submitted by this request. Form nodes may be used to populate the method and url properties by some transports. This property may be removed in the future as it pertains exclusively to in-browser HTTP transports.

sync:

Boolean, defaults to false. sync determines whether the accepting transport should attempt to make the request synchronously. Transports that support synchronous operation will block execution of other code until the bind is complete.

bindSuccess:

Boolean, defaults to false. Indicates whether or not this Request was accepted and dispatched by any transport.

useCache:

Boolean, defaults to false. Indicates whether the result of the request should be cached and whether requesting a result for this request from the cache is acceptable.

timeout:

              请求超时时间

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载