Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

selectÔªËØjavascript³£ÓòÙ×÷

 *˵Ã÷£ºselectÔªËØjavascript³£ÓòÙ×÷
* 1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem
* 2.¼ÓÈëÒ»¸öItem
* 3.ɾ³ýֵΪvalueµÄËùÓÐItem
* 4.ɾ³ýijһ¸öindexµÄÑ¡Ïî
* 5.¸üеÚindexÏîµÄvalueºÍtext
* 6.ÉèÖÃselectÖÐÖ¸¶¨textµÄµÚÒ»¸öItemΪѡÖÐ
* 7.ÉèÖÃselectÖÐÖ¸¶¨valueµÄµÚÒ»¸öItemΪѡÖÐ
* 8.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄvalue
* 9.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄindex
* 10.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄtext
* 11.Çå¿ÕËùÓÐÑ¡Ïî
-------------------------------------------------------*/
//1.ÅжÏÊÇ·ñ´æÔÚÖ¸¶¨valueµÄItem
function ExistValue(obj,value){
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == value){
return true;
}
}
return false;
}
//2.¼ÓÈëÒ»¸öItem
function AddItem(obj,text,value){
var varItem = new Option(text,value);
obj.options.add(varItem);
}
//3.ɾ³ýֵΪvalueµÄËùÓÐItem
function RemoveItems(obj,value){
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == ItemValue){
obj.options.remove(i);
}
}
}
//4.ɾ³ýijһ¸öindexµÄÑ¡Ïî
function RemoveItem(obj,index){
obj.options.remove(index);
}
//5.¸üеÚindexÏîµÄvalueºÍtext
function UpdateItem(obj,index,value,text){
obj.options[index].value = value;
obj.options[index].text = text;
}

//6.ÉèÖÃselectÖÐÖ¸¶¨textµÄµÚÒ»¸öItemΪѡÖÐ
function SelectItemByText(obj,text){
var isExit = false;
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].text == text){
obj.options[i].selected = true;
return true;
}
}
return false;

}
//7.ÉèÖÃselectÖÐÖ¸¶¨valueµÄµÚÒ»¸öItemΪѡÖÐ
function SelectItemByValue(obj,value){
var isExit = false;
for(var i=0;i<obj.options.length;i++){
if(obj.options[i].value == value){
obj.options[i].selected = true;
return true;
}
}
return false;

}
//8.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄvalue£¬index,text
function GetValue(obj){
return obj.value;
}
//9.µÃµ½µ±Ç°Ñ¡ÖÐÏîµÄindex
function GetInd


Ïà¹ØÎĵµ£º

Javascriptµ÷ÓÃWebService

WebServiceÎļþ£º
  [WebMethod]
public int DoMulti(int num1,int num2)
{
int result;
result = num1 * num2;
return result;
}
ASPXÎļþ£º
<%@ Page language="c#" Codebehind="Javascript.aspx.cs" AutoEventWireup="false" Inherits=" ......

Ò»¸ö´øCheckBoxµÄÊ÷ÐÎĿ¼µÄµÝ¹éËã·¨£¨javascript£©


°¦£¬ºÜ¾ÃÒÔǰдµÄ´úÂ룬ɹһɹ£¬¹À¼Æ×Ô¼º¿´¶¼¿´²»¶®ÁË£¬:(
var head="display:''"
img_close=new Image()
img_close.src="/sysManage/images/f.gif"
img_open=new Image()
img_open.src="/sysManage/images/fo.gif"
img3=new Image()
img3.src="/sysManage/images/e.gif" ......

javascript ´òÓ¡Ô¤ÀÀµÄʵÏÖ

Òý×Ô£ºhttp://blog.csdn.net/lsj19830812/archive/2007/10/25/1843578.aspx
 a.jspÊÇÒª´òÓ¡µÄÒ³Ãæ
<html>
<head>
<script language="javascript">
function fmtPrint(printPlace,w,h){
var sarg=new Array();
var sdata=document.all.item(printPlace);
sarg[0]=s ......

¹ØÓÚjavascript ²Ù×÷¹â±ê

°æ±¾£ºDHTML Object Model¡¡·µ»ØÖµ£ºÓÐ
Óï·¨£º
oTextRange = object . createTextRange ()
²ÎÊý£º
ÎÞ
·µ»ØÖµ£º
oTextRange : ¶ÔÏó(Element)¡£Èç¹û³É¹¦µÄ»°·µ»Ø±»½¨Á¢µÄ TextRange ¶ÔÏó¡£
˵Ã÷£º
Ϊ object ½¨Á¢ TextRange ¶ÔÏó¡£
ʹÓÃ´Ë TextRange ¶ÔÏó¿ÉÒÔ¼ìË÷ºÍÐÞ¸Ä object ÄÚµÄÎı¾¡£ TextRange ¶ÔÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ