DWR util.js 学习笔记
DWR? util.js 学习笔记
/********************/
/********************/
util.js包含一些有用的函数function,用于在客户端页面调用.
主要功能如下:
???? 待续…………………………………………
/********************************************************************************/
/***********************QQ: 171505924 Gump **************************************/
/********************************************************************************/
?? 4、getText? 取得text属性值
?????
????? DWRUtil.getText(id): 用来获得 option 中的文本
????? 比如:
????? 调用 DWRUtil.getText("select"); 将返回 "香蕉" 字段;
????? DWRUtil.getText(id);仅仅是用来获得 select 文本值,其他不适用。
?? /******************************************************************************/
?? /******************************************************************************/
?? /******************************************************************************/
?? 5、DWRUtil.getValue(id): 用来获得 form 表单值
?????
????? 有如下几种情况:
???
?? /******************************************************************************/
?? /******************************************************************************/
?? /******************************************************************************/
?????
?? 7、DWRUtil.onReturn 防止当在文本框中输入后,直接按回车就提交表单。
???? <input type="text" onkeypress="DWRUtil.onReturn(event, submitFunction)"/>
???? <input type="button" onclick="submitFunction()"/>
?? /******************************************************************************/
?? /******************************************************************************/
?? /******************************************************************************/
?? 8、DWRUtil.selectRange(ele, start, end);
????? 在一个input box里选一个范围
结果 文本框中的值"2345678901234"将被选中'
?? /******************************************************************************/
?? /******************************************************************************/
?? /******************************************************************************/
?? 9、DWRUtil.setValue(id,value);
????? 为指定的id元素,设置一个新值;
?? /******************************************************************************/
?? 10、DWRUtil.setValues({?
name: "fzfx88",
password: "1234567890"
}
?????? ); 同上,批量更新表单值.
?? /******************************************************************************/
?? 11、DWRUtil.toDescriptiveString()
?? 带debug信息的toString,第一个为将要debug的对象,第二个参数为处理等级。等级如下:
??? 0: Single line of debug 单行调试?
??? 1: Multi-line debug that does not dig into child objects 不分析子元素的多行调试?
??? 2: Multi-line debug that digs into the 2nd layer of child objects 最多分析到第二层子元素的多行调试
??? <input type="text" id="text">
??? DWRUtil。toDescriptiveString("text",0);
?? /******************************************************************************/
?? 12、DWRUtil.useLoadingMessage();
??? 当发出ajax请求后,页面显示的提示等待信息;
- ???function?searchUser(){ ??var?loadinfo?=?"loading....."??try{ ??????regUser.queryAllUser(userList); ??????DWRUtil.useLoadingMessage(loadinfo);???????? ??}catch(e){ ????} ?????}??