尝试运行我以前在纯Web js中的节点中运行的功能,而未使用节点执行。无法弄清楚为什么找不到postOrderMarket函数。
<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"};