<create creator="new" javascript="MathDelegate"> <param name="class" value="practicaldwr2project.chapter02.seconddwr.MathDelegate" /> </create>
public int add(int a, int b) {return a + b;}
function callMathDelegateAdd() { MathDelegate.add(5, 5, {callback :doMathCallback});} function doMathCallback(inResp) {alert(inResp);}
或者采用
function callMathDelegateAddInline() { MathDelegate.add(7, 7, { callback : function(inResp) {alert(inResp);}});}