我正在尝试使用 Ext JS 6.2.0 创建一个简单的应用程序 un Netbeans。
在 ui.js 文件中,我只是创建了一个工具栏和一个表单。
var toolbar = Ext.create('Ext.toolbar.Toolbar', {
renderTo: document.body,
width : 400,
margin : '5 0 0 0',
items : [{
xtype: 'datefield',
anchor: '100%',
format: 'W-Y',
fieldLabel: 'From',
name: 'from_date',
maxValue: new Date() // limited to the current date or prior
}]
});
Ext.create('Ext.form.Panel', {
renderTo: document.body,
title: 'User Form',
height: 300,
width: 585,
defaults: {
xtype: 'textfield',
labelAlign: 'top',
padding: 10
},
layout: 'hbox',
items: [toolbar]
});
然后在 index.jsp 中,我调用这个文件和其他文件,例如 theme-classic-all-debug.css、theme-classic-debug.js 和 ext-all-debug.js。
我将它与这些标签结合起来:
<script src="WEB-INF/ext-6.2.0/build/ext-all-debug.js" type="text/javascript"></script>
<link href="WEB-INF/ext-6.2.0/build/classic/theme-classic/resources/theme-classic-all-debug.css" rel="stylesheet" type="text/css"/>
但问题是,当我尝试运行应用程序时,在浏览器的控制台中,我看到了这些错误并且页面没有显示任何内容。
错误:
- -西班牙语 - -
El script de “http://localhost:8080/pruebaMCC/WEB-INF/ext-6.2.0/build/ext-all-debug.js” fue cargado a pesar de que su tipo MIME (“text/html”) no es un tipo MIME válido de JavaScript.
Ha fallado la carga del <script> con origen "http://localhost:8080/pruebaMCC/WEB-INF/ext-6.2.0/build/ext-all-debug.js".
- -英语 - -
<script> loading with source "http: // localhost: 8080 / test MCC / WEB-INF / ext-6.2.0 / build / ext-all-debug.js" failed.
我不知道我该如何解决它。
请帮我。
谢谢,苏菲