我正在尝试通过dart:js context
对象添加handsontable,但收到错误:
Exception: Uncaught Error: NoSuchMethodError: method not found: 'jQuery'
Receiver: Instance of 'JsObject'
Arguments: ["#handsontable"]
我的HTML:
<script src="../lib/jquery-1.11.1.js"></script>
<script src="../lib/jquery.handsontable.full.js"></script>
<link rel="stylesheet" media="screen" href="../lib/jquery.handsontable.full.css">
<script type="javascript">
$(document).ready(function(){
console.log('jquery initialized' + $('#handsontable'));
})
</script>
<script async type="application/dart" src="propmgmt.dart"></script>
<script async src="packages/browser/dart.js"></script>
这样称呼它:
var hot_data = new JsObject.jsify({
'colHeaders': colHeaders,
'data': rows
});
print('jQuery (as \$): ${context[r'$']}');
print('jQuery: ${context['jQuery']}');
context
.callMethod('jQuery', ['#handsontable'])
.callMethod('handsontable', [hot_data]);
“jquery initialized”未显示在控制台中。