来自Browserify的功能未定义

时间:2018-08-06 01:00:23

标签: javascript jquery httprequest browserify

尝试运行我以前在纯Web js中的节点中运行的功能,而未使用节点执行。无法弄清楚为什么找不到postOrderMarket函数。

enter image description here

  <body>
    <div class="main">
    </div>
  </body>

  <script type="text/javascript" src="res/jquery-3.3.1.min.js"></script>
  <script type="text/javascript" src="res/bundle.js"></script>
<script type="text/javascript">
$(".main").click(function() {
  postOrderMarket(100);
});
</script>

bundle.js代码的小部分

[function(require,module,exports){
    var request = require('request');
    var crypto = require('crypto');


      module.exports = function postOrderMarket(amount) {
        var verb = 'POST',
          path = '/api/v1/order',
          expires = new Date().getTime() + (60 * 1000),
          data = {symbol:"XBTUSD",side:"Buy",orderQty:amount,ordType:"Market"};

0 个答案:

没有答案