易截截图软件、单文件、免安装、纯绿色、仅160KB

【技术积累】JavaScript【消息框】

在JavaScript中可以创建三种消息框:警告框、确认框、提示框
警告框经常用于确保用户可以得到某些信息。当警告框出现后,用户需要点击确定按钮才能继续进行操作。
语法:
alert("文本")
确认框用于使用户可以验证或者接受某些信息。当确认框出现后,用户需要点击确定或者取消按钮才能继续进行操作。如果用户点击确认,那么返回值为 true。如果用户点击取消,那么返回值为 false。当需要换行时加上"/n"
语法:
confirm("文本")
提示框经常用于提示用户在进入页面前输入某个值。当提示框出现后,用户需要输入某个值,然后点击确认或取消按钮才能继续操纵。如果用户点击确认,那么返回值为输入的值。如果用户点击取消,那么返回值为 null。
语法:
prompt("文本","默认值")


相关文档:

利用javaScript动态增加表格行,删除表格行

示例:
- - - - - - - - - - - -
<body>
<input type="button" value="create" onclick="createTr();">
<table border='1' id="t" >
</table>
<input type="button" value="提交" onclick="okss();" />
</body>
<script type="text/javascript">
  &nbs ......

Javascript实用函数

function addLoadEvent(fun) {
var oldonload = window.onload;
if(typeof(window.onload) != 'function') {
window.onload = fun;
} else {
window.onload = function() {
oldonload();
fun();
}
}
}
//function insertAfter(newElement, targentElement)
function insertAfter(insertedNode, ......

Javascript日期格式 正则 yyyy MM dd

reg = /^((((((0[48])|([13579][26])|([2468][048]))00)|([0-9][0-9]((0[48])|([13579][26])|([2468][048]))))-02-29)|(((000[1-9])|(00[1-9][0-9])|(0[1-9][0-9][0-9])|([1-9][0-9][0-9][0-9]))-((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30))|(((0[1-9])|(1[0-2]))-((0[1-9])|(1[0-9])|(2[0-8]))))))$/i; ......

JavaScript constructor属性

Definition and Usage
定义与用法The constructor property is a reference to the function that created an object.
constructor属性是所建立对象的函数参考Syntax
语法object.constructor
Example 1
举例
In this example we will show how to use the constructor property:
在这个举例中我们将展示如何使用cons ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号