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

JavascriptºÍAjaxÖÐÎÄÂÒÂëÍÂѪ°æ½â¾ö·½°¸

Òý×Ô£ºhttp://www.cnblogs.com/dongritengfei/archive/2009/12/21/1628489.html
 
½ñÌìŪÁËÒ»ÌìµÄAjaxÖÐÎÄÂÒÂëÎÊÌ⣬AjaxµÄÂÒÂëÎÊÌâ·ÖΪÁ½ÖÖ£º
1. JavaScriptÊä³öµÄÖÐÎÄÂÒÂ룬
±ÈÈ磺alert("ÖÐÎÄÂÒÂë²âÊÔ");
½â¾öµÄ°ì·¨±È½Ï¼òµ¥£¬¾ÍÊǰÑjspÀïËùÓеÄcharsetºÍpageEncodingµÄÖµ¶¼ÉèÖóÉÏàͬµÄ£¬Ò»°ãÊÇutf-8.
 
2. ÕâµÚ¶þÖÖ¾ÍÊÇAjax´Ó·þÎñÆ÷¶Ë»ñµÃµÄÊý¾Ý³öÏÖÂÒÂëµÄÎÊÌâ¡££¨ÎÒËÑÁËn¸öСʱÊÔÁËnÖз½·¨²ÅÕÒµ½´ð°¸£©
ÏÖÔÚ½«ÎÒËѼ¯µÄ±È½ÏÓÐЧµÄ·½·¨¶¼Óë´ó¼Ò·ÖÏí£º£¨ÎÒʹÓõĿª·¢»·¾³ÊÇEclipse£¬ÏàÐÅÆäËûÓïÑԺͿª·¢»·¾³¶¼²î²»Ì«¶à¡££©
 ±ÈÈç
var message = xmlHttp.responseText;
 alert("message: "+message);
»ñµÃÕâ¸ömessageÊä³ö¾ÍÊÇÂÒÂë
 
½â¾ö°ì·¨£º
1. Ð޸ıàÂë¡£ÇмÇÒª½«´úÂ뱸·Ýһϣ¬¸ÄÁ˱àÂëÖ®ºóÖÐÎÄ»á±äΪÂÒÂë¡£
ÔÚjsÎļþÉÏÓÒ¼üµã»÷Properties£¬ÐÞ¸ÄText file encode ΪUTF-8£¨ÕâÀïÓ¦µ±ÓëjspÖеıàÂëÏàͬ£© 
 
ͬÑùµÄ½«JavaScript source fileºÍJSPµÄDefault encodingÉèÖÃΪUTF-8£¨ÕâÀïÓ¦µ±ÓëjspÖеıàÂëÏàͬ£¬ÕâÑùÒÔºóµÄÏîÄ¿¾Í¶¼ÊÇutf-8µÄ±àÂëÁË£¬ÍƼöʹÓÃÕâ¸ö£©
2. ×¢Òâresponse.setContentType("text/html;charset=utf-8");ºÍPrintWriter out = response.getWriter();µÄλÖùØÏµ£¬ÇмÇÒª½«PrintWriter out = response.getWriter();·ÅÔÚresponse.setContentType("text/html;charset=utf-8");µÄºóÃæ£¬·ñÔòÉèÖõıàÂ뽫ÎÞЧ£¬ÕâÒ²ÊÇÎÒŪÁËn¾Ã¶¼¸ã²»¶¨µÄÔ­Òò£¡£¡£¡
 
²¹³ä£º½Å±¾¿ÉÒÔÕâÑùд£º
<script for="cu_model" event="onChange" language=VBScript charset="utf-8">
</script >


Ïà¹ØÎĵµ£º

javascript ´¥·¢Ê¼þÁбí


Ò»°ãʼþ
ʼþä¯ÀÀÆ÷Ö§³ÖÃèÊö
onClick
HTML: 2 | 3 | 3.2 | 4 
Browser: IE3 | N2 | O3 
Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick
HTML: 2 | 3 | 3.2 | 4 
Browser: IE4 |&nb ......

JavascriptÖг£Óõö¼¼ÇÉ


1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)> <td>no </table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡Ïûѡȡ¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut=" ......

javascript µÄ±Õ°ü

±Õ°ü£¨closure£©ÊÇJavascriptÓïÑÔµÄÒ»¸öÄѵ㣬ҲÊÇËüµÄÌØÉ«£¬ºÜ¶à¸ß¼¶Ó¦Óö¼ÒªÒÀ¿¿±Õ°üʵÏÖ¡£
ÏÂÃæ¾ÍÊÇÎÒµÄѧϰ±Ê¼Ç£¬¶ÔÓÚJavascript³õѧÕßÓ¦¸ÃÊǺÜÓÐÓõġ£
Ò»¡¢±äÁ¿µÄ×÷ÓÃÓò
ÒªÀí½â±Õ°ü£¬Ê×ÏȱØÐëÀí½âJavascriptÌØÊâµÄ±äÁ¿×÷ÓÃÓò¡£
±äÁ¿µÄ×÷ÓÃÓòÎ޷ǾÍÊÇÁ½ÖÖ£ºÈ«¾Ö±äÁ¿ºÍ¾Ö²¿±äÁ¿¡£
JavascriptÓïÑÔµÄÌØÊâÖ®´¦£¬¾ÍÔÚÓ ......

JavaScript¶ÔÏóÄ£ÐÍ Ö´ÐÐÄ£ÐÍ

Êý¾ÝÀàÐÍ
»ù±¾Êý¾ÝÀàÐÍ
»ù±¾Êý¾ÝÀàÐÍÊÇJSÓïÑÔ×îµ×²ãµÄʵÏÖ¡£
¼òµ¥ÊýÖµÀàÐÍ: ÓÐUndefined, Null, Boolean, NumberºÍString¡£×¢Ò⣬ÃèÊöÖеÄÓ¢Îĵ¥´ÊÔÚÕâÀï½öÖ¸Êý¾ÝÀàÐ͵ÄÃû³Æ£¬²¢²»ÌØÖ¸JSµÄÈ«¾Ö¶ÔÏóN an, Boolean, Number, StringµÈ£¬ËüÃÇÔÚ¸ÅÄîÉϵÄÇø±ðÊDZȽϴóµÄ¡£
¶ÔÏó: Ò»¸öÎÞÐòÊôÐԵļ¯ºÏ£¬ÕâЩÊôÐÔµÄֵΪ¼òµ¥ÊýÖµÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ