JS操作select相关方法:新增 修改 删除 选中 清空 判断存在 等
1.判断select选项中 是否存在Value="paraValue"的Item
2.向select选项中 加入一个Item
3.从select选项中 删除一个Item
4.修改select选项中 value="paraValue"的text为"paraText"
5.设置select中text="paraText"的第一个Item为选中
6.设置select中value="paraValue"的Item为选中
7.得到select的当前选中项的value
8.得到select的当前选中项的text
9.得到select的当前选中项的Index
10.清空select的项
-------------------------------------------
//1.判断select选项中 是否存在Value="paraValue"的Item
function jsSelectIsExitItem(objSelect,objItemValue)
窗口最大化
<body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)">
禁止右键
document.oncontextmenu = function() { return false;}
禁止保存 <noscript><iframe src="*.htm"></iframe></noscript>
禁止选取<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"
onselect="document.selection.empty)" oncopy="document.selection.empty)" onbeforecopy=
"return false"onmouseup="document.selection.empty()>
禁止粘贴<input type=text onpaste="return false">
根据宽度换行 style="word-break:break-all"
//消除图像工具栏
[/html]
<IMG SRC="mypicture.jpg" HEIGHT="100px" WIDTH="100px" GALLERYIMG="false">
or
<head>
<meta http-equiv="imagetoolbar" content="no">
</head>
[/html]
//取得控件得绝对位置(1)
<script language="javascript"> <br />
function getoffset(e) <br />

//下载文件


function DownURL(strRemoteURL,strLocalURL)
1 父子页面的值传递
两种方式:
1)在父页面可以通过pagename操作子页面。
pagename = window.open('page ','name','width,height'); pagename.focus();
在子页面可以通过parents.Label.innerText = '"value"'
2)通过模态对话框返回值。当执行模态对话框时,父页面将停止操作。
在父页面
var result = showModalDialog(url,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;scroll:no;status:no");
alert(result)
在子页面
<script language='javascript'>
window.returnValue = 'True';
window.close()
</script>
3) 通过vArguments将父窗体的值传递到子窗体
<script>
var obj = new Object();
obj.name="51js";
window.showModalDialog ("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
</script>
modal.htm
<script>
var obj = window.dialogArguments
alert("您传递的参数为:" + obj.name)
</script>
4) 子窗体使父窗体刷新
opener.window.location.reload();
5) 避免提交时弹出另一个页面
<head>标签里加入<base target="_self">
6) 避免模式窗体不刷新
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
2 将javascript值赋给session
新建一个框架,不让他显示出来。在页面里
document.all('djTmp').src="djTmp.aspx?name=RoleName&value=" + document.all('cboRole').value
在框架网页里
Dim strName As String = Request.QueryString("name")
Dim strValue As String = Request.QueryString("value")
Session(strName) = strValue
3 服务器控件取js值。
新建一隐藏控件。将其设为服务器端运行,这样通过脚本和服务器都可以访问。

参考:http://neozhu.cnblogs.com/archive/2005/07/28/201838.aspx
http://www.phpx.com/happy/showthread.php?threadid=101722&goto=nextnewest
//==========================================================================
//
// 代码描述:将某个datagrid中模板的中checkbox置为相反状态
//
// 传入参数:Form --- 当前页面ID 例: xt_function_m
// CheckBox --- 被选择的字符 例: 'CheckBoxSelect'
//
// 返回参数:无
//
//
//==========================================================================
function SelectTitleAll(Form, CheckBox)
}
5,在客户端javascript里操作服务端控件:
this.Button1.Attributes.Add("onclick","return upchang();");
function upchang()