[英]Aptana Javascript how to run a single javascript program in aptana
all I would like to do is run this simple program in Aptana to see if it works, but it doesnt even show up. 我想做的就是在Aptana中运行这个简单的程序,看看它是否有效,但它甚至都没有显示出来。 I used the Javascript Template from Aptana's selection.
我使用了Aptana选择的Javascript模板。 here is the program.
这是程序。
<script type = "text/javascript" >
function verse (verseNum) {
var lines = "";
if (verseNum ==1 ) {
lines = "One thing I dont know why...";
} else if (verseNum == 1 {
lines = "All I know time is a valuable thing...";
} else {
lines = "NoLyrics";
}
return (lines);
}
alert (verse(1));
alert (verse(2));
</script>
When I run the program, it shows a blank webpage. 当我运行该程序时,它显示一个空白的网页。 I am sure it is a very simple mistake, probably completely wrong format.
我确信这是一个非常简单的错误,可能完全错误的格式。 Any help is appreciated.
任何帮助表示赞赏。
You are missing a parenthesis, added here: 你缺少一个括号,在这里添加:
} else if (verseNum == 1) {
You need to use your browser's console to discover such errors, although I'm surprised that Aptana doesn't indicate it as well. 您需要使用浏览器的控制台来发现此类错误,尽管我很惊讶Aptana也没有指出它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.