大家好,新人求教。 以下是我的代码index.html
<script type="text/javascript" src="class/nomalclass.js"></script>
<script type="text/javascript">
window.onload=function()
{
var group = new grouplist;      //此处如果我加一个(),就报错;
alert(group.groups);
document.getElementById("group").onchange=function()
  {
alert(1);
  }
}
</script>
nomalclass.js
function grouplist()
{
this.groups = "test";
}但是如果我这么写,如下index.html
<script type="text/javascript" src="class/nomalclass.js"></script>
<script type="text/javascript">
var group = new grouplist;      //此处加不加(),都可以;
alert(group.groups);
document.getElementById("group").onchange=function()
{
alert(1);
}
</script>
nomalclass.js
function grouplist()
{
this.groups = "test";
}求高人指点--