js保留n位小数——toFiexed()
摘要:js 四舍五入函数 toFixed(),里面的参数 就是保留小数的位数。 <script language="javascript"> document.write("<h1>JS保留两位小数例子</h1><br>"); var a=2.1512131231231321; document.writ
阅读全文
js和(jQuery)取值(转)
摘要:1: 根据class 、 id 取 input 标签的value 值 。 jQuery : $(".className").val(); $("#idName").val(); javaScript : document.getElementById("idName").value; 2: 根据cl
阅读全文
easyUI页面取值
摘要:取datagrid里的值 function saveInfo(index){ var ed = $('#dg').datagrid('getEditor',{'index':index,'field':'GDJC'}); var testTmp = $(ed.target).parents('.da
阅读全文
easyiUI调整行高
摘要:/* 设置数据行高 */ .datagrid-row { height: 35px; } /* 设置数据字体 */ .datagrid-cell { font-size:20px; } /* 设置列名称字体 */ .datagrid-header .datagrid-cell span{ font-
阅读全文
js闭包
摘要:闭包:当内部函数 在定义它的作用域 的外部 被引用时,就创建了该内部函数的闭包 ,如果内部函数引用了位于外部函数的变量,当外部函数调用完毕后,这些变量在内存不会被 释放,因为闭包需要它们. <p>局部变量计数。</p><button type="button" onclick="myFunction
阅读全文