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

javascript对象机制

                var currItem = listbox.options[currIndex];
                var prevItem = listbox.options[currIndex - 1];
                //alert(currItem);
                alert(prevItem.text);
                listbox.options[currIndex - 1].text = currItem.text;
                listbox.options[currIndex - 1].value = currItem.value;
                alert(prevItem.text);  //两次alert值是不同的
                listbox.options[currIndex].text = prevItem.text;
                listbox.options[currIndex].value = prevItem.value;


相关文档:

javascript调用java代码,el表达式

我们在jsp页面上的js脚本中可以调研java代码,比如,我们需要再js中用alert函数显示服务器端发送过来的某个字符串那么我们可以这样做
tomcat下:
在服务器端我们有request.setAttribute("name","abc");
那么我要在页面上用alert显示的话,有两种方式:
1、使用EL表达式
  在El表达式的外面用引号即可:
<scri ......

a标签中的href,onclick,#,javascript:void简要分析

<script type="text/javascript">
window.onbeforeunload=function()
{
alert("onbeforeunload event...");
//return false;
}
</script>
<a href="#" onclick="return true;">测试1</a><br/>
<a href="javascript:void(0)" onclick="return true;">测试2</a><br/& ......

10个基于JavaScript的WYSIWYG(所见即所得)编辑器


在线编辑内容的时候,那些基于 JavaScript 的编辑器帮了我们大忙,这些所见即所得(WYSIWYG)编辑器,给我们提供了类似
Office 的操作体验。如今,任何网站内容管理系统(CMS)和博客系统都需要一个这样的编辑器。本文精选了10个基于 JavaScript 
的编辑器,它们有的是基于 jQuery 框架,有点则不是。
Mar ......

用JavaScript去除字符串的首尾空格。

String.prototype.Trim=function(){
returnthis.replace(/(^\s*)|(\s*$)/g,"");
}
String.prototype.LTrim=function(){
returnthis.replace(/(^\s*)/g,"");
}
String.prototype.RTrim=function(){
returnthis.replace(/(\s*$)/g,"");
} ......

用JavaScript检查文件是否存在

function checkImgAddr(url){
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("post",url,false);
xmlhttp.send();
if(xmlhttp.readyState==4){
if(xmlhttp.status==404){
return "File Not Exist.";
}else if(xmlhttp.status == 200){
re ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号