易截截图软件、单文件、免安装、纯绿色、仅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使用技巧精萃

(一).确认删除用法:
  1. BtnDel.Attributes.Add("onclick","return confirm('"+"确认删除?"+"')");
  2. linktempDelete.Attributes["onclick"]="javascript:return  confirm('"+"确认删除?"+"');";
  3. privat ......

JavaScript方法和技巧大全

             JavaScript方法和技巧大全
1:基础知识
1 创建脚本块
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script>
2 隐藏脚本代码
1: <script language=”JavaScript”>
2: ......

利用JavaScript实现上传图片预览

<script >
function showimage()

       //IMG1为图片控件或Div,File1为上传文件控件
document.getElementById("IMG1"). src = document.getElementById("File1").value;
}
</script >
控件中引用:
<input id="File1" runat="server" type="file"  onc ......

javascript动态添加/删除div


添加
<script>
var oDiv = document.createElement("DIV");
oDiv.id = "shop01";
oDiv.style.top = 200;
oDiv.style.left = 200;
oDiv.style.background = '#FFFF00';
oDiv.style.visibility = 'visible';
oDiv.innerHTML="123123"
document.body.appendChild(oDiv ......

Javascript 中对HTML编码和解码的方法

String.prototype.HTMLEncode = function() {
var temp = document.createElement ("div");
(temp.textContent != null) ? (temp.textContent = this) : (temp.innerText = this);
var output = temp.innerHTML;
temp = null;
return output;
}
String.prototype.HTMLDecode = function() {
var temp = doc ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号