0.1.7 • Published 7 years ago

bug-reporter v0.1.7

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bug-reporter

A pure JavaScript library handle report error message

Installation

$ npm install --save bug-reporter

Usage

使用 LeanCloud 或 自备后台服务器接口 (可同时一起使用)保存 Bug 信息。

  <!DOCTYPE html>
  <html lang="en">
  <head>
    <meta charset="UTF-8">
    <script src="/path/to/bugReporter.min.js"></script>
    <script type="text/javascript">
      window.bugReporter.init({
        url: '/bug/reporter',
        type: 'post',
        success: function(text) {
          console.log(text)
        },
        fail: function(req) {
          console.error(req);
        }
      });
    </script>
  </head>
  <body>
  </body>
  </html>

or

<script src="//unpkg.com/bug-reporter/lib/bugReporter.min.js"></script>

Options

Methods

  • init
  @param    {Object} opts - bugReporter options
  • destory
  • report
  @param    {String} method - 'GET' or 'POST' or 'JSON'
  @param    {String} url
  @param    {Object} data
  @param    {Function} cbSucs - success callback
  @param    {Function} cbFail - fail callback
  • sendData
  @param    {Object} data
  @param    {Function} fn
  @param    {Object} obj
  @param    {Function} method
  @param    {Array} args

License

MIT

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago