请教javascript函数形参是如何获得数据的?

来源:百度知道 编辑:UC知道 时间:2024/05/27 08:12:11
以下是代码,这个function InfoCommand(name, interaction)两个形参从哪边获得数据的,还有就是这里面的函数在什么情况下会被调用。我是一个js初学者,对这个不是太懂,谢谢啦!

function InfoCommand(name, interaction)
{
if (arguments.length > 0) {
this.Init(name, interaction);
}
}
InfoCommand.prototype = new MapCommand();
InfoCommand.prototype.constructor = InfoCommand;
InfoCommand.superclass = MapCommand.prototype;//which is itself a property of every constructor prototype
InfoCommand.prototype.Execute = function() //to create inherited properties, and shared methods. 共享只分配一个实例
{
this.CreateUrl();
this.AddParamToUrl("PixelTolerance", this.pixelTolerance);
//create an XMLHttp obj to send request to server
var xmlHttp = CreateXMLHttp();
xmlHttp.open("GET", this.url, false);
xmlHttp.send(null);
//get response back
this.result = xmlHttp.responseText;

var div = FindElement("Info");
if(div.style.vi

代码不全,调用的地方没贴出来啊。
应该是某个按钮或是文本框控件等的事件处理吧。

InfoCommand(name, interaction)
自己写了这么一个方法。谁知道你要从哪里调用它呀。