项目作者: arodu

项目描述 :
Easy comet with jquery
高级语言: JavaScript
项目地址: git://github.com/arodu/jquery.comet.git
创建时间: 2016-08-26T16:07:17Z
项目社区:https://github.com/arodu/jquery.comet

开源协议:

下载


Easy jQuery.comet

  • Install

    1. bower install arodu-jquery-comet
  • Connection

    1. var comet = $.comet({
    2. url: 'comet.php',
    3. onMessage: function(m){
    4. // Actions
    5. }
    6. });
  • start

    1. comet.start();
  • stop

    1. comet.stop();
  • options

    1. $.comet({
    2. url: 'comet.php',
    3. timeout: 60000,
    4. type: 'GET',
    5. dataType: 'json',
    6. autoStart: true,
    7. url: null, // String
    8. onMessage: function(){},
    9. onError: function(){},
    10. });