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

javascript php Ö®¼ä´«µÝ ÖÐÎÄ ±ÜÃâÂÒÂë

ÔÚjavascript´úÂëÖÐÓÃencodeURIComponent()º¯Êý´¦ÀíÖÐÎÄ×Ö·û´®£¬
JS´úÂ룺
<mce:script type=”text/javascript”><!--
string = encodeURIComponent(string);
location.href = index.php?keyword=’+string;
// --></mce:script>
PHP´úÂë:
<?php
$keyword = (isset($_GET['keyword'])) ? $_GET['keyword'] : '';
?>
±£Ö¤JavaScriptºÍAsp¡¢PhpµÈºó¶Ë³ÌÐò¼ä´«Öµ±àÂëͳһ
ÔÚ·ÇÓ¢ÎÄ×Ö·û¼¯µÄÒ³ÃæÉÏ£¬Èç¹ûʹÓÃAjax·½Ê½½øÐÐÊý¾Ý½»»¥µÄ»°£¬
¾Í±ØÐëҪעÒⱣ֤ǰºó¶ËÊý¾ÝµÄͳһ±àÂ룬·ñÔò£¬ºÜÈÝÒ׾ͳöÏÖÂÒÂ룡
ÔÚºó¶ËÊÇASP³ÌÐòµÄÇé¿öÏ£¬±£³ÖÇ°¶ËJavascriptºÍAspÖ®¼ä´«ÖµµÄͳһ±àÂë¿ÉÒÔʹÓÃÒÔϺ¯Êý½øÐд¦Àí£º
±àÂ룺escape(string)
½âÂ룺unescape(string)
ÕâÁ½¸öº¯ÊýÔÚJavaScriptºÍAspÀﶼ´æÔÚ£¬¶øÇÒ¹¦ÄÜÍêÈ«Ò»Ñù£¬
Ö»ÒªÈκÎÒ»¶ËÏòÁíÒ»¶Ë´«Êý¾Ý£¬¶¼ÏÈÓÃescape½øÐбàÂ룬
½ÓÊÕµÄÒ»¶ËÓÃunescape½øÐнâÂë¼´¿É±£Ö¤JavascriptºÍAspÊý¾Ý´«µÝ¹ý³ÌÖв»»á³öÏÖÂÒÂ룡
ÔÚºó¶ËÊÇPHP³ÌÐòµÄÇé¿öÏ£¬±£³ÖÇ°¶ËJavascriptºÍPHPÖ®¼ä´«ÖµµÄͳһ±àÂë¿ÉÒÔʹÓÃÒÔϺ¯Êý½øÐд¦Àí£º
WEBÇ°¶ËJavaScript
±àÂ룺encodeURI(string)
½âÂ룺decodeURI(string)
WEBºó¶ËPhp
±àÂ룺urlencode(string)
½âÂ룺urldecode(string)
ͬÑù£¬´«ÖµµÄʱºòʹÓÃÏàÓ¦µÄ±àÂ뺯ÊýencodeURI»òurlencode£¬
½ÓÊÕµÄʱºòʹÓÃÏàÓ¦µÄ½âÂ뺯ÊýdecodeURI»òurldecode£¬
¼´¿É±£Ö¤JavascriptºÍPhpÊý¾Ý´«µÝ¹ý³ÌÖв»»á³öÏÖÂÒÂ룡
ÔÚWEBÇ°¶ËJavascript½âÂë,PhpÀïurlencode±àÂëµÄÊý¾Ýʱ£¬¿ÉÄÜÐèҪʹÓÃÁ½´Î½âÂ룬È磺
unescape(decodeURI(string))
unescapeÓÃÀ´½âһЩ·Ç×Ö·ûÀàµÄÎÄ×Ö£¬Èç±êµã·ûºÅµÈµÈ¡£ 


Ïà¹ØÎĵµ£º

javascriptЧÂʾ­Ñé̸(Ò»)

±¾ÎÄÖ÷ÒªÊdzöÓÚÓÐÅóÓÑʹÓÃÎÒÔ­À´Ð´µÄautocompleteµÄJS¿Ø¼þ¡£µ±Êý¾ÝÁ¿´óµÄʱºò£¬»á³öÏÖЧÂʼ«ÆäÂýµÄÇé¿ö£¬ÎÒÔÚÕâ¶Îʱ¼ä×ö³öµÄһЩ²âÊÔÒ²¼°Ò»Ð©¾­Ñ飬Óë´ó¼Ò·ÖÏí£¬Èç¹ûÓдíµÄµØ·½£¬»¹ÇëÖ¸³ö¡£
¾­¹ý²âÊÔ£¬ÎÒÃǻᷢÏÖÈçϵÄÇé¿ö»òÕß˵µÄ½áÂÛ£¬Èç¹ûÄúµÄ²âÊÔ½á¹ûÓëÎҵIJ»·û£¬Çë˵Ã÷Ô­Òò£¬ÒÔ±ãÏ໥ѧϰ¡£
1£©µ±Ò»¸ö½Ï´óµÄHTML×Ö· ......

javascript keycode´óÈ«

    IE   event.keyCode
keycode    8 = BackSpace BackSpace
keycode    9 = Tab Tab
keycode   12 = Clear
keycode   13 = Enter
keycode  &nb ......

javascriptʵÓõÄN¸öСÀý×Ó

°æȨÉùÃ÷£ºÔ­´´×÷Æ·£¬ÔÊÐíתÔØ£¬×ªÔØʱÇëÎñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕ ԭʼ³ö´¦ ¡¢×÷ÕßÐÅÏ¢ºÍ±¾ÉùÃ÷¡£·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£http://gzycm520.blog.51cto.com/175220/36822
· Ê¼þÔ´¶ÔÏó event.srcElement.tagName event.srcElement.type
· ²¶»ñÊÍ·Å event.srcElement.setCapture();  ......

phpÒ³Ãæ³£ÓõÄjs

echo "<script language='javascript'>
alert('ͼÊéÐÅÏ¢Ìí¼Ó³É¹¦!');history.back();</script>";
¡¾ ×ÖÌ壺<A href="javascript:ContentSize(16)">´ó</A>
                   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ