JavaScriptÖеÄÈýÖÖµ¯³ö¿ò
JavaScriptÖеÄÈýÖÖµ¯³ö¿ò:¾¯¸æ(alert)¡¢È·ÈÏ(confirm)ÒÔ¼°ÌáÎÊ(prompt)
<script type="text/JavaScript">
function testAlert(){
alert("ÎÒ¾ÍÊÇ´«ËµÖеÄalert!!!");
}
function testConfirm(){
var r=confirm("ÄãÊDzËÄñÂð£¿");
if(r==true){
alert("±Ë´Ë±Ë´Ë");
}
else{
alert("ÎÒÊÇÀÏÄñ");
}
}
function testPrompt(){
var score;
var degree;
score=prompt("ÄãµÄ·ÖÊýÊÇ");
if(score>100){
degree="Ë£ÎÒ£¬100¾ÍÂú·ÖÀ²£¡";
}else if(score<0){
degree="Ë£ÎÒ£¬×îÉÙÒ²µÃ¸ø¸öÁãµ°°¡";
}
else{
switch(parseInt(score/10)){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5: degree="ûÓм°¸ñ"; break;
case 6: degree="¸Õ¼°¸ñ";break;
case 7:
case 8:degree="²»´í£¬¼ÌÐøÅ¬Á¦";break;
case 9:degree="ºÜºÃ£¬¿ìÂú·ÖÀ²";break;
case 10:degree="Âú·ÖÀ²";break;
}
}
alert(degree);
}
</script>
<form action="#" method="post">
<p>
<button value="alert" onclick="testAlert()">µ÷ÓÃalert</button>
</p>
<p>
<button onclick="testConfirm()" value="confirm">µ÷ÓÃconfirm</button>
</P>
<p>
<button onclick="testPrompt()" value="prompt">µ÷ÓÃprompt</button>
</p>
</form>
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐĿǰ¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×î¶¥¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×î¶¥¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
ÎÒÃÇÀ´Ä£·ÂÒ»ÏÂ×îOOµÄmootoolsµÄ¼Ì³Ð»úÖÆ¡£ËüµÄÀà¶¼ÓÐÒ»¸ö½Ð×öinitialize¹¹Ôì·½·¨£¬ÕâÓëJavaµÄÀà¶¼ÓÐÒ»¸öÓëÀàÃûͬÃûµÄ¹¹Ôì·½·¨Ò»ÑùµÄµÀÀí¡£Ö»²»¹ý£¬ÕâЩ½Ðinitialize»òinit¶¼ÊÇ½è¼ø×ÔPrototype£¬¶øPrototypeÄǰïÈËÊÇRuby³öÉí¡£ÎªÁËÇø±ðmootoolsÄÇÖÖÎÛȾÔÉú·½·¨µÄ×ö·¨£¬ÎÒ°ÑÀàµÄ¹¹ÔìÆ÷ÃüÃûΪvariant£¬²¢ÇÒ½ûÖ¹²é¿´¹¹Ô ......
±¾Ê¾ÀýÊÇҪʵÏÖÓÃjavascript½Å±¾¶ÁÈ¡xmlÎĵµ£¬ÔÚxmlÎĵµÖÐʵÏÖÔ¼Êø¹¦ÄÜ£¬test.htmlÎļþ´úÂëÈçÏ£º
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<script type="text/javascript">
......
<HTML>
<HEAD><TITLE>WMI Scripting HTML</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=JScript event="OnCompleted(hResult,pErrorObject, p ......