Javascript 如何在Eclipse的Apatana插件中构造ExtJS项目
各位 我是ExtJS新手。我使用Aptana插件制作ExtJS应用程序,但不知何故无法运行它。我有一个如下所示的项目结构,其中我尝试运行一个简单的Javascript 如何在Eclipse的Apatana插件中构造ExtJS项目,javascript,eclipse,extjs,aptana,Javascript,Eclipse,Extjs,Aptana,各位 我是ExtJS新手。我使用Aptana插件制作ExtJS应用程序,但不知何故无法运行它。我有一个如下所示的项目结构,其中我尝试运行一个简单的HelloWorld示例 helloWorld.js-JavaScript文件,我在其中编写ExtJS代码 index.html-用于运行应用程序的html页面 这个项目目录正确吗?为什么我无法运行应用程序 helloWorld.js: function buildWindow() { var win = new Ext.Window
HelloWorld
示例
helloWorld.js
-JavaScript文件,我在其中编写ExtJS代码
index.html
-用于运行应用程序的html页面
这个项目目录正确吗?为什么我无法运行应用程序
helloWorld.js:
function buildWindow() {
var win = new Ext.Window({
id : 'myWindow',
title : ' My first Ext JS Window',
width : 300,
height : 150,
layout : 'fit',
autoLoad : {
url : 'sayHi.html',
scripts : true
}
});
win.show();
}
Ext.onReady(buildWindow);
index.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title id='title'>HTML Page setup Tutorial</title>
<!-- ** CSS ** -->
<!-- base library -->
<link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" />
<!-- overrides to base library -->
<!-- ** Javascript ** -->
<!-- ExtJS library: base/adapter -->
<script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>
<!-- ExtJS library: all widgets -->
<script type="text/javascript" src="../../ext-all-debug.js"></script>
<!-- overrides to library -->
<!-- extensions -->
<!-- page specific -->
<script type="text/javascript" src="../helloWorld.js">
</script>
</head>
<body>
</body>
</html>
HTML页面设置教程
看起来您的helloWorld.js加载错误
替换这些:
<script type="text/javascript" src="../helloWorld.js">
</script>
为此:
<script type="text/javascript" src="helloWorld.js"></script>
您的helloWorld.js
与您的index.html
坐在一起,而不是上一层
(我无法判断您是否正确加载了库。它在文件夹结构中不可见)我应该将其放置在哪里?
index.html
文件中应该有什么变化?啊,只要将加载helloworld.js
:)的那一行替换为我应该替换的那一行就行了?我的意思是,我应该把helloWorld.js文件放在目录中的什么地方?哪个文件夹?不,如中所示,因为您的helloWorld.js和index.html放在同一个文件夹中,所以您需要做的只是将上面的一行替换为index.html中的一行。你看到我写的那一行和index.html中的那一行有什么不同吗?看到了吗。。但是没有成功。。还是不跑