求助大佬 我这个编译没问题但是输出什么都没有
程序代码:
<html> <body> <script type="text/javascript"> var i; function user() { this.name = new Array(); } user.prototype.getname() = function () { this.name[0]=prompt("enter your group name"," "); this.name[1]=prompt("enter your group name"," "); this.name[2]=prompt("enter your group name"," "); this.name[3]=prompt("enter your group name"," "); for(i=0;i<4;i++) {while(this.name[i]==" ") { this.name[i]=prompt("enter your group name"," "); } } } user.prototype.setname()=function(){ for(i=0;i<4;i++) document.write(this.name[i]); } var a=new user(); a.getname(); a.setname(); </script> </body> </html>