這是一個基本問題。抱歉。關於初始化器的簡單問題
我有以下代碼:
$extend(ImageCrop, Options.prototype);
Swiff.Uploader = new Class({
Extends: Swiff,
Implements: Events,
options: {
path: "Swiff.Uploader.swf",
target: null,
zIndex: 9999,
height: 30,
width: 100,
callBacks: null,
params: {
wMode: "opaque",
menu: "false",
allowScriptAccess: "always"
},
typeFilter: null,
multiple: true,
queued: true,
verbose: false,
url: null,
method: null,
data: null,
mergeData: true,
fieldName: null,
fileSizeMin: 1,
fileSizeMax: null,
allowDuplicates: false,
buttonImage: null,
policyFile: null,
fileListMax: 0,
fileListSizeMax: 0,
instantStart: false,
appendCookieData: false,
fileClass: null
},
initialize: function (b) {
this.addEvent("load", this.initializeSwiff, true).addEvent("select", this.processFiles, true).addEvent("complete", this.update, true).addEvent("fileRemove", function (e) {
this.fileList.erase(e)
} .bind(this), true);
this.setOptions(b);
if (this.options.callBacks) {
Hash.each(this.options.callBacks, function (f, e) {
this.addEvent(e, f)
}, this)
}
this.options.callBacks = {
fireCallback: this.fireCallback.bind(this)
};
var d = this.options.path;
if (!d.contains("?")) {
d += "?noCache=" + $time()
}
...............................
,當我在this.setOptions(b);
設置斷點,看b varible的價值我看到已經初始化varible但爲什麼呢?我在哪裏設定b值?我只是將它作爲參數傳遞。我認爲b的價值必須是'空'或什麼的。
是MooTools的''類構造函數嗎? – CMS 2010-09-14 20:23:43
@CMS是的。我想是這樣。 – Neir0 2010-09-14 20:34:51