开发者

JavaScript framework with, or easily extendable with, support for XmlHttpRequest.onprogress (emulated if necessary)

开发者 https://www.devze.com 2023-02-24 04:33 出处:网络
Which of JavaScript libraries and frameworks has support for \"onprogress\" event for XmlHttpRequest (perhaps as a plugin or extension), emulated if necessary?Alternatively which JavaScript framework

Which of JavaScript libraries and frameworks has support for "onprogress" event for XmlHttpRequest (perhaps as a plugin or extension), emulated if necessary? Alternatively which JavaScript framework would be easiest to extend to support xhr.onprogress?

By "emulated if necessary" I mean here that if web browser doesn't support XHR 2.0 "onprogress" event, then "onreadystatechange" would be used. Because some browsers fire onreadystatechange only once for each state, and do not call onreadystatechange on server flush, then some kind of timer / interval would probably be necessary to periodically check XHR object if it is such browser.

  • jQuery and YUI provide o开发者_Python百科nly success and error (or equivalent) callback
  • MooTools provide 'progress' event, but limited to Browsers that support the event. (At this time: Gecko and WebKit).


You may be able to extend jQuery to achieve what you desire with $.ajax Transports. You will have to do all the hard work yourself though.

0

精彩评论

暂无评论...
验证码 换一张
取 消