2006-10-31 22:37:27 | 编辑
DWR中的util.js
$("id") 大概等价于document.getElementById("id")
如果返回结果唯一的话返回该元素的值,不唯一则返回一个数组
.另外,如果单独使用util.js的话,可能在IE5以下的浏览器中无法正常使用,需要跟engine.js配合使用.
注意,这里得到的是一个对象,如果需要得到该对象的值的话,需要用innerHTML来取得.或者直接用DWRUtil.getValue ("elementId")来取值.
DWRUtil.toDescriptiveString("elementId",debugLevel),这是一个debug用的函数.第一个参数是元素的id,第二个参数是debug等级,可以是0,1,2.随着等级增加,输出信息也会增加.注意这个函数只是一个debug工具,不要对它抱有太大幻想.
DWRUtil.getText ("elementId"),返回一个select下拉菜单中的text值.仅适用于select类型的元素.
DWRUtil.getValue ("elementId"),返回一个元素的值,This
method works for most HTML elements including selects (where the option with a
matching value and not text is selected), input elements (including textareas)
divs and spans
DWRUtil.getValues ({ div:null,
textarea:null, select:null, text:null,
password:null, formbutton:null,
button:null }),返回一个对象包含这些元素的值,暂时不知道做什么用的.
DWRUtil.onReturn(event, submitFunction) 定义在输入框中按回车的响应,防止执行submit.
DWRUtil.addOptions() 一个重要的方法
Copyright 1999-2006 duduwolf.com Some Rights Reserved.