ÈýÖÖ²»Í¬Î»ÖõÄJavaScript´úÂëµÄд·¨
¿Í»§¶Ë½Å±¾JavaScriptÔÚд·¨ÉÏÆäʵÓкܶàÖÖ·½·¨£¬ËüÃǵķÅÖÃλÖÃÒ²·Ç³£Ö®¶à¡£¡£
ÏÂÃæÁоÙÔÚÈýÖÖ²»Í¬µÄµØ·½Ð´JavaScript´úÂ룬ʵÏÖµÄЧ¹û¶¼Êǵã»÷°´Å¥buttonµ¯³öalert¾¯¸æ¿ò
µÚÒ»ÖÖÊÇ×î³£¼ûµÄ£¬´úÂëÈçÏÂ
html´úÂë
<input type="button" value="°´Å¥1" id="btn1" onclick="pop()">
js´úÂë
function pop()
{
alert("ÔÚJavaScriptº¯Êý´¦µ÷ÓÃ");
}
µÚ¶þÖÖÊÇ×î¼òµ¥µÄʵÏÖ·½Ê½£¬´úÂëÈçÏÂ
<input type="button" value="°´Å¥2" id="btn2" onclick="javascript:alert('Ö±½Óдº¯Êý');">
µÚÈýÖÖ·½Ê½Ïà¶Ô¸´ÔÓ£¬´úÂëÈçÏÂ
html´úÂë
<input type="button" value="°´Å¥3" id="btn3">
js´úÂë
var obj=document.getElementById("btn3");//ÒÔÏÂÓï¾äÒ»¶¨Òª·ÅÔÚ¶¨Òåbtn3µÄÏÂÃ棬·ñÔò±àÒëÆ÷ÊDz»ÄÜʶ±ðbtn3µÄ¡£
if(window.addEventListener)// Mozilla, Netscape, FirefoxµÈä¯ÀÀÆ÷
{
obj.addEventListener("click",fun,false);//×¢ÒâÕâÀïµÄfalse
}
else //IEä¯ÀÀÆ÷
{
obj.attachEvent("onclick",fun);
}
function fun()
{
alert("ͨ¹ýÔÚº¯ÊýÖд¥·¢Ê¼þ");
}
×ܽ᣺ÈýÖÖд·¨·½Ê½ÊµÏÖµÄЧ¹ûÊÇÍêÈ«Ò»ÑùµÄ£¬Ó¦¸Ã˵ÈýÖÖ·½Ê½¶¼Êdz£Óõģ¬¶øÇÒ¸÷ÓÐÓÅȱµã¡£¡£¡£¡£
Ïà¹ØÎĵµ£º
/********************
* È¡´°¿Ú¹ö¶¯Ìõ¸ß¶È
******************/
function getScrollTop()
{
var scrollTop=0;
if(document.documentElement&&document.documentElement.scrollTop)
{
......
<script type="text/javascript">
function fnOnPageChanged(page) {
var url = '<?=url('ShowFront','Search',$Request);?>' + '&page=' + page;
//alert(url);
document.location.href = url;
}
</script>
<select id="selectPage" onChange="fnOnPageC ......
Ö»ÄÜÊäÈëÊý×Ö£º"^[0-9]*$"
Ö»ÄÜÊäÈë n λµÄÊý×Ö£º"^\d{n}$"
Ö»ÄÜÊäÈëÖÁÉÙ n λµÄÊý×Ö£º"^\d{n,}$"
Ö»ÄÜÊäÈë m ¡« n λµÄÊý×Ö£º"^\d{m,n}$"
Ö»ÄÜÊäÈëÁãºÍ·ÇÁ㿪ͷµÄÊý×Ö£º"^(0|[1-9][0-9]*)$"
Ö»ÄÜÊäÈëÓÐÁ½Î»Ð¡ÊýµÄÕýʵÊý£º"^[0-9]+(.[0-9]{2})?$"
Ö»ÄÜÊ ......
¶ÔÓÚWEB³ÌÐòÀ´Ëµ£¬Ç°¶Ë£¨JavaScript£©ºÍºó¶Ë£¨JSP/Servlet£©ÊÇû·¨¹²ÓÃÊý¾ÝµÄ£¬Ö»ÄÜÊǺó¶Ë³ÌÐò£¨JSP£©°ÑÊý¾ÝÊä³ö£¬Éú³ÉÒ³Ãæµ½
Ç°¶Ë£¬ÕâʱºòÉú³ÉµÄÒ³ÃæÖеÄJavaScript´úÂë²ÅÓпÉÄܵõ½ËùνjspµÄÊý¾Ý¡£Í¬ÑùµÄ£¬Ö»ÓаÑJavaScriptÀïµÄÊý¾ÝÌá½»¸øºó¶ËJSP´ú
Â룬JSP³ÌÐòÖвÅÄܵõ½JavaScriptµÄÊý¾Ý¡£
......