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

Javascript²Ù×÷select¿Ø¼þ´óÈ«

1ÅжÏselectÑ¡ÏîÖРÊÇ·ñ´æÔÚValue="paraValue"µÄItem 
 2ÏòselectÑ¡ÏîÖР¼ÓÈëÒ»¸öItem 
 3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem 
 4ɾ³ýselectÖÐÑ¡ÖеÄÏî 
 5ÐÞ¸ÄselectÑ¡ÏîÖРvalue="paraValue"µÄtextΪ"paraText" 
 6ÉèÖÃselectÖÐtext="paraText"µÄµÚÒ»¸öItemΪѡÖР
 7ÉèÖÃselectÖÐvalue="paraValue"µÄItemΪѡÖР
 8µÃµ½selectµÄµ±Ç°Ñ¡ÖÐÏîµÄvalue 
 9µÃµ½selectµÄµ±Ç°Ñ¡ÖÐÏîµÄtext 
10µÃµ½selectµÄµ±Ç°Ñ¡ÖÐÏîµÄIndex 
11Çå¿ÕselectµÄÏî 
 // 1.ÅжÏselectÑ¡ÏîÖÐ ÊÇ·ñ´æÔÚValue="paraValue"µÄItem
function jsSelectIsExitItem(objSelect, objItemValue) {
var isExit = false;
for (var i = 0; i < objSelect.options.length; i++) {
if (objSelect.options[i].value == objItemValue) {
isExit = true;
break;
}
}
return isExit;
}

// 2.ÏòselectÑ¡ÏîÖÐ ¼ÓÈëÒ»¸öItem
function jsAddItemToSelect(objSelect, objItemText, objItemValue) {
//ÅжÏÊÇ·ñ´æÔÚ
if (jsSelectIsExitItem(objSelect, objItemValue)) {
alert("¸ÃItemµÄValueÖµÒѾ­´æÔÚ");
} else {
var varItem = new Option(objItemText, objItemValue);
objSelect.options.add(varItem);
alert("³É¹¦¼ÓÈë");
}
}

// 3.´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem
function jsRemoveItemfromSelect(objSelect, objItemValue) {
//ÅжÏÊÇ·ñ´æÔÚ
if (jsSelectIsExitItem(objSelect, objItemValue)) {
for (var i = 0; i < objSelect.options.length; i++) {
if (objSelect.options[i].value == objItemValue) {
objSelect.options.remove(i);
break;
}
}
alert("³É¹¦É¾³ý");
} else {
alert("¸ÃselectÖÐ ²»´æÔÚ¸


Ïà¹ØÎĵµ£º

ÔÚUpdatepanelÖÐʹÓÃJAVASCRIPTµÄÎÊÌâ(ת)

ÔÚUpdatepanelÖÐʹÓÃJAVASCRIPTµÄÎÊÌâ
ÔÚUpdatePanle×ÜʹÓÃjavascriptÈ磺Response.Write("<script language='javascript'>alert('" + error.Message.ToString() + "');history.back(-1);</script>"); ʱ£¬µ¯³öÀ´Ò»¸öÌáʾ¶Ô»°¿ò
Sys.WebForms.PageRequestManagerParserErrorException:
The   message ......

JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2

Ô­ÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2-showModalDialog  
ǰһƪÎÄÕÂJavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµÖн²µ½ÁËÈçºÎÀûÓÃwindow.open()·½·¨´ò¿ªÐ´°Ì壬²¢ÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµµÄ·½·¨¡£javascriptÖл¹ÓÐÒ»¸öº¯Êýwindow.showModalDialogÒ²¿ÉÒÔ´ò¿ªÒ»¸öд°Ì壬²»¹ýËû´ò¿ªµÄÊÇÒ»¸öģ̬´°¿Ú£¬ÄÇôÈçºÎÔÚ¸¸´°Ì ......

ÓÃJavascript»ñÈ¡Ò³ÃæÔªËصÄλÖÃ

ÖÆ×÷ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹Ø֪ʶ¡£
Ò»¡¢ÍøÒ³µÄ¾ø¶Ô´óСºÍÏà¶Ô´óС
Ê×ÏÈ£¬ÒªÃ÷È·Á½¸ö»ù±¾¸ÅÄî¡£
Ò»ÕÅÍøÒ³µÄÈ«²¿Ãæ»ý£¬¾ÍÊÇËüµÄ¾ø¶Ô´óС¡£Í¨³£Çé¿öÏ£¬ÍøÒ³µÄ¾ø¶Ô´óСÓÉÄÚÈݺÍCSSÑùʽ±í¾ö¶¨¡£
ÍøÒ³µÄÏà¶Ô´óСÔòÊÇÖ¸ÔÚä¯ÀÀÆ÷´°¿ÚÖп ......

ÓÃJavascript¶¨Î»ÔªËØλÖÃÈ«¹¥ÂÔ


¼ÙÉè obj Ϊij¸ö HTML ¿Ø¼þ¡£
obj.offsetTop Ö¸ obj ¾àÀëÉÏ·½»òÉϲã¿Ø¼þµÄλÖã¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetLeft Ö¸ obj ¾àÀë×ó·½»òÉϲã¿Ø¼þµÄλÖã¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetWidth Ö¸ obj ¿Ø¼þ×ÔÉíµÄ¿í¶È£¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetHeight Ö¸ obj ¿Ø¼þ×ÔÉíµÄ¸ß¶È£¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
ÎÒÃǶÔÇ°ÃæÌáµ½µÄ“ ......

JavaScriptÄÚÖöÔÏóÊôÐÔ¼°·½·¨´óÈ«


1.Date
ÊôÐÔ(1):
constructor      Ëù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼
prototype       Äܹ»Îª¶ÔÏó¼ÓÈëµÄÊôÐԺͷ½·¨
·½·¨(43):
getDay()        ·µ»ØÒ»ÖÜÖеĵڼ¸Ìì(0-6)
getYear()       ·µ»ØÄê·Ý.2000ÄêÒÔǰΪ2λ,2000 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ