// set Process
i18n.setProcess(function() {diFunctions.getI18n('http://localhost/service/i18n/page?lang=eng&group=staff') });
// Setter and getter
this.setProcess = function(opProcess) { //here param opProcess is function with parameters see i18n.setProcess() line of code
if(opProcess == undefined)
throw "Process is undefined";
if($.isFunction(opProcess) == false)
throw "Process is not a function"
process = opProcess;
};
this.getProcess = function() {
return process;
};
瞭解i18n.setProcess如何將帶param的函數作爲參數傳遞給setProcess。將參數添加到動態函數
現在我想我在SetProcess是什麼function() {diFunctions.getI18n('http://localhost/service/i18n/page?lang=eng&group=staff',**id**)
// ID動態添加到了傳遞作爲參數傳遞給setProcess
問題本身的功能 - 我要動態添加ID(在我的類變量定義總是入店通過id)在設置過程中加入函數參數(Url等等,id)。函數參數可以增長,但最後應該添加id作爲參數?
嘗試了很多解決方案,但沒有解決?檢查here
PS我沒有發佈代碼,因爲它的巨大隻是張貼了我想做的事情,如果這就是爲什麼downvote是 – inputError