13. Shibuya, Tokyo
commonJS
場所: {projectFolder}/Modules/myRPC.JS (サブフォルダーでも良い)
構成: 1 file/module, n functions/module
javascript: not just for browsers any more!
http://www.commonjs.org/specs/modules/1.0/
戻り値: 必須 (null, ""でも良い)
アクセス権: module毎, function毎
JSON-RPC
.../Configuring-CommonJS-Modules-for-RPC.300-306585.ja.html
39. Shibuya, Tokyo
.../Using-JSON-RPC-Services/Error-Handling.300-306655.ja.html
button1.click = function button1_click (event)
try {
{
var a = $$('textField1').getValue();
var b = $$ ('textField2').getValue();
var result = myRPC.add(a,b);
$$('richText1').setValue(result);
} catch (e) {
console.log(e.message);
}
e.code: エラーコード
e.message: エラーメッセージ
error handling
JSON-RPC
41. Shibuya, Tokyo
.../Using-JSON-RPC-Services/Error-Handling.300-306655.ja.html
button1.click = function button1_click (event)
try {
{
var a = $$('textField1').getValue();
var b = $$ ('textField2').getValue();
var result = myRPC.add(a,b);
$$('richText1').setValue(result);
} catch (e) {
console.log(e.message);
}
e.code: エラーコード
e.message: エラーメッセージ
error handling
JSON-RPC
42. Shibuya, Tokyo
.../Using-JSON-RPC-Services/Error-Handling.300-306655.ja.html
try {
{
var a = $$('textField1').getValue();
var b = $$ ('textField2').getValue();
var result = myRPC.add(a,b);
$$('richText1').setValue(result);
} catch (e) {
console.log(e.data);
}
e.code: エラーコード
e.message: エラーメッセージ
error handling
e.data: エラーメッセージオブジェクト
button1.click = function button1_click (event)
JSON-RPC