javascript Öпؼþ±³¾°É«µÄÉèÖÃ
function Search(){
//Èç¹ûÇ°Ò»¸ö¿Ø¼þµÄÖµ´óÓÚºóÒ»¸ö¿Ø¼þµÄÖµ(Ç°ÌáÊǺóÒ»¸ö¿Ø¼þ²»ÊÇ¿Õ,¿ÕµÄÇé¿öϲ»×öÈκδ¦Àí)
if(document.forms[0].koteifrom.value > document.forms[0].koteiTo.value && document.forms[0].koteiTo.value != ""){
alert('messageÄÚÈÝ');
var koteifrom = document.getElementById("koteifrom");//¿Ø¼þµÄÈ¡µÃ
var koteiTo = document.getElementById("koteiTo");//¿Ø¼þµÄÈ¡µÃ
koteifrom.style.backgroundColor = "#ffcccc";//¿Ø¼þµÄ±³¾°É«±äΪ×غìÉ«,´¦Àí½áÊø
koteiTo.style.backgroundColor = "#ffcccc";
return;
}
document.forms[0].action="./xxxxxxxxAction.do";
document.forms[0].submit();
}
ÔÚhtmlÖÐÓÐÒÔÏÂÁ½¸ö¿Ø¼þ:
<td width="530px">
<html:select name="xxxxxxForm" property="koteifrom" style="width:250px;" >
<html:optionsCollection name="SCOM" property="key(xxxxx).subKey(KoteiComboList)" />
</html:select> ¡« <html:select name="xxxxxxForm" property="koteiTo" style="width:250px;" >
<html:optionsCollection name="SCOM" property="key(xxxxx).subKey(KoteiComboList)" />
</html:select>
</td>
Ïà¹ØÎĵµ£º
ÄÚÖÃÀà
JavaScriptÊÇÒ»ÖÖ»ùÓÚ¶ÔÏóµÄ½âÊÍÐÔ±à³ÌÓïÑÔ£¬ËùÓеÄÔªËØ£¬ÎÒÃǶ¼¿ÉÒÔÀí½âΪ¶ÔÏó£¬Ã¿¸ö¶ÔÏóÒ²¿ÉÒÔÀí½âΪN¶àÊôÐԵļ¯ºÏ¡£ÔÚÌÖÂÛ×Ô¶¨ÒåÀà֮ǰ£¬ÎÒÃÇÏÈ¿´Ò»ÏÂÄÚÖõÄÀà¡£×÷Ϊ½âÊÍÐÔÓïÑÔ£¬JavaScriptÔÊÐíÎÒÃÇÔÚÈκÎʱºòΪ¶ÔÏóÌí¼ÓÊôÐÔ¡£ËùÒÔÎÒÃÇ¿ÉÒÔÏÈ¿´Ò»¶Î¼òµ¥µÄ´´½¨¶ÔÏóµÄ´úÂëƬ¶Î¡£ÕâÀïµÄ“new Object”Ò²¿ ......
±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
1.ÈçºÎ´´½¨Êý×é
2.ÈçºÎ¶ÔÊý×é½øÐвÙ×÷£¨Ìí¼Ó,ɾ³ý,¶ÁÈ¡)
3.Êý×é³£¼û·½·¨ºÍÊôÐÔ
ÈçºÎ´´½¨Ò»¸öÊý×é,Ò»°ãµØ¸ù¾Ý³õʼ»¯É趨¼òµ¥·ÖΪ3ÖÖ:
1.µ¥´¿´´½¨Êý×é:
var arr=new Array();
Òªµã:ÓÃnew¹Ø¼ü×Ö´´½¨Êý×é¶ÔÏóArray(),Array()¶ÔÏóÊÇÒ»¸ö±¾µØÀà,¿ÉÒÔÓÃnew´´½¨Ò»¸ö¶ÔÏóºóʹÓÃ
2.´´½¨Ê ......
Ô¤¶¨Ê±¼äÖ®ºóÖ´Ðк¯Êý
setTimeout("functionname",interval)
ÌáÈ¡×Ö·û´®ÖÐÊýÖµÐÅÏ¢
parseInt(string)
¸´Öƽڵã(ÊÇ·ñ¸´ÖÆ×Ó½Úµã)
cloneNode(true/false)
ɾ³ý×Ó½Úµã
removeChild()
Ìæ»»½Úµã
replaceChild(newChild,oldChild)
×Ó½ÚµãÅжÏ
hasChildNodes ......
¼ìË÷:
1 ÓÃ||À´Ìî³äĬÈÏÖµ
var status = flight.status || "unknown";
2 ʹÓÃ&&·ÀÖ¹TypeError
flight.equipment.model //throw "TypeError"
flight.equipment && flight.equipment.model //undefined
ÒýÓÃ
var a={},b={},c={};
document.writeln(a===b); //false
ÔÐÍ
Javascript ......