私はこのコードを持っています。display
メソッドを使用すると、次のようになります。
URL が未定義です
名前は未定です
説明は未定義です
すべての正当性を提供しているのに、なぜエラーが発生するのかわかりません。誰かが私のために問題を特定できますか?
function website(name,url,description)
{
//Proparties
this.name=name;
this.url=url;
this.description=description;
// Methods
this.getName=getName;
this.getUrl=getUrl;
this.getDescription=getDescription;
this.display=display;
// GetName Method
function getName(name)
{
this.getName=name;
}
// GetUrl Method
function getUrl(url){
this.getUrl=url;
}
// getDescription
function getDescription(description){
this.getDescription=description;
}
function display(name,url,description){
alert("URL is :" +url +" Name Is :"+name+" description is: "+description);
}
}
// Set Object Proparites
web=new website("mywebsite","http://www.mywebsite.com","my nice website");
// Call Methods
var name = web.getName("mywebsite");
var url = web.getUrl("http://www.mywebsite.com");
var description = web.getDescription("my nice website");
web.display(name,url,description);