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µÄÎÊÌâ
ÔÚUpdatePanle×ÜʹÓÃjavascriptÈ磺Response.Write("<script language='javascript'>alert('" + error.Message.ToString() + "');history.back(-1);</script>"); ʱ£¬µ¯³öÀ´Ò»¸öÌáʾ¶Ô»°¿ò
Sys.WebForms.PageRequestManagerParserErrorException:
The message ......
ÔÎÄ£ºÁõÎä|JavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«Öµ2-showModalDialog
ǰһƪÎÄÕÂJavascriptÔõôÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµÖн²µ½ÁËÈçºÎÀûÓÃwindow.open()·½·¨´ò¿ªÐ´°Ì壬²¢ÔÚÁ½¸ö´°ÌåÖ®¼ä´«ÖµµÄ·½·¨¡£javascriptÖл¹ÓÐÒ»¸öº¯Êýwindow.showModalDialogÒ²¿ÉÒÔ´ò¿ªÒ»¸öд°Ì壬²»¹ýËû´ò¿ªµÄÊÇÒ»¸öģ̬´°¿Ú£¬ÄÇôÈçºÎÔÚ¸¸´°Ì ......
ÖÆ×÷ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹Ø֪ʶ¡£
Ò»¡¢ÍøÒ³µÄ¾ø¶Ô´óСºÍÏà¶Ô´óС
Ê×ÏÈ£¬ÒªÃ÷È·Á½¸ö»ù±¾¸ÅÄî¡£
Ò»ÕÅÍøÒ³µÄÈ«²¿Ãæ»ý£¬¾ÍÊÇËüµÄ¾ø¶Ô´óС¡£Í¨³£Çé¿öÏ£¬ÍøÒ³µÄ¾ø¶Ô´óСÓÉÄÚÈݺÍCSSÑùʽ±í¾ö¶¨¡£
ÍøÒ³µÄÏà¶Ô´óСÔòÊÇÖ¸ÔÚä¯ÀÀÆ÷´°¿ÚÖп ......
¼ÙÉè obj Ϊij¸ö HTML ¿Ø¼þ¡£
obj.offsetTop Ö¸ obj ¾àÀëÉÏ·½»òÉϲã¿Ø¼þµÄλÖã¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetLeft Ö¸ obj ¾àÀë×ó·½»òÉϲã¿Ø¼þµÄλÖã¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetWidth Ö¸ obj ¿Ø¼þ×ÔÉíµÄ¿í¶È£¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
obj.offsetHeight Ö¸ obj ¿Ø¼þ×ÔÉíµÄ¸ß¶È£¬ÕûÐÍ£¬µ¥Î»ÏñËØ¡£
ÎÒÃǶÔÇ°ÃæÌáµ½µÄ“ ......
1.Date
ÊôÐÔ(1):
constructor Ëù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼
prototype Äܹ»Îª¶ÔÏó¼ÓÈëµÄÊôÐԺͷ½·¨
·½·¨(43):
getDay() ·µ»ØÒ»ÖÜÖеĵڼ¸Ìì(0-6)
getYear() ·µ»ØÄê·Ý.2000ÄêÒÔǰΪ2λ,2000 ......