Tornado 6.5 Documentation
more advanced asynchronous example, take a look at the chat example application, which implements an AJAX chat room using long polling. Users of long polling may want to override on_connection_close() to If you submit AJAX POST requests, you will also need to instrument your JavaScript to include the _xsrf value with each request. This is the jQuery function we use at FriendFeed for AJAX POST requests undefined; } jQuery.postJSON = function(url, args, callback) { args._xsrf = getCookie("_xsrf"); $.ajax({url: url, data: $.param(args), dataType: "text", type: "POST", success: function(response) { callback(eval("("0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
example application [https://github.com/tornadoweb/tornado/tree/stable/demos/chat], which implements an AJAX chat room using long polling [http://en.wikipedia.org/wiki/Push_technology#Long_polling].Users of submit AJAX POST requests, you will also need to instrument your JavaScript to include the _xsrf value with each request. This is the jQuery [http://jquery.com/] function we use at FriendFeed for AJAX POST } jQuery.postJSON = function(url, args, callback) { args._xsrf = getCookie("_xsrf"); $.ajax({url: url, data: $.param(args), dataType: "text", type: "POST", success: function(response)0 码力 | 437 页 | 405.14 KB | 2 月前3
共 2 条
- 1
相关搜索词