AJAXÖÐÎÄÂÒÂëPHPÍêÃÀ½â¾ö£¨IEºÍFirefox¼æÈÝ£©
×î½üÔÚ×öÒ»¸ö¿¼ÊÔϵͳÏîÄ¿£¬Óöµ½AJAXÖÐÎÄÂÒÂëÎÊÌ⣬¾¹ýÒ»¸öÏÂÎçµÄŬÁ¦ÖÕÓÚÍêÃÀ½â¾ö£¬ÏÖ½«ÐĵÃдÏÂÀ´£¬Ï£Íû¶ÔÄÇЩ»¹À§ÈÆÔÚÕâ¸öÎÊÌâ¶øÍ·Í´²»ÒѵÄÈËÃÇÓÐËù°ïÖú¡£
ÖÚËùÖÜÖª£¬Ê¹ÓÃAJAX´«ËͺͽÓÊÕÖÐÎIJÎÊýʱ£¬Èç¹û²»ÔÚ¿Í»§¶ËºÍ·þÎñÆ÷×öÏàÓ¦µÄ´¦Àí¾Í»á³öÏÖÂÒÂëÎÊÌ⣬ÔÚÍøÉÏÏàÓ¦µÄÎÄÕÂÒ²²»ÉÙ£¬µ«ÊÇÓеÄÇé¿öϺÜÄÑ´ÓÖÐÕÒµ½·ûºÏ×Ô¼ºÀíÏëµÄ´ð°¸£¬ÎÒ½ñÌì¾ÍÊÇÔÚÍøÉÏÕÒÁ˺ܶ࣬µ«ÊǶ¼²î²»¶à£¬½²ASPºÍJSPµÄ±È½Ï¶à£¨ÎÒÊÇÓõÄPHP£©£¬ËùÒÔµ½×îºó¶¼Ã»ÕÒµ½×Ô¼ºÂúÒâµÄ´ð°¸¡£
AJAXµÄÖÐÎÄÂÒÂë¿ÉÒÔ´ó¸Å·ÖΪÁ½ÖУ¬µÚÒ»ÖÖÊÇÏò·þÎñÆ÷¶Ë·¢ËÍÖÐÎIJÎÊýʱ£¨xmlhttp.open(“get|post”,url,true)£©,·þÎñÆ÷¶Ë½ÓÊÕµ½µÄΪÂÒÂ룬Õâ¸öÒ²ÊÇÎÒ½ñÌìÓöµ½µÄÎÊÌ⣬û×ö´¦Àí֮ǰ£¬ÔÚIEÀïÊÇÕý³£µÄ£¬µ«ÊÇÔÚFirefoxÀïÃæ¾Í³öÏÖÁËÂÒÂ룬ÎÒÏȰѽÓÊÕµ½²ÎÊýÊä³öµ½Ò»¸öÎı¾ÀûÓз¢ÏÖʲôÎÊÌ⣬ÓôÃÆÁË£¬È»ºóÎҾͰѲéѯÓï¾äÔÚÊä³öÀ´¹Û²ì£¨ÎÒÕâÀïÊÇÒª´ÓÊý¾Ý¿âÀï²é³öÓë²ÎÊýÏà¹ØµÄ¶«Î÷£©£¬ÖÕÓÚ·¢ÏÖÎÊÌ⣬IEºÍFirefoxÊä³öµÄ²ÎÊý²»Ò»Ñù£¬ËäÈ»ºº×ÖÉ϶¼Ò»Ñù£¬µ«ÊǺÍÇ°ºóÁ¬½ÓÉÏÓÐϸСµÄÇø±ð£¬ÓÚÊÇÈ϶¨ÁËÊDZàÂëÎÊÌ⣬ÔÚÍøÉϲéÕÒÁËÏà¹Ø×ÊÁÏ£¬¶¼Ã»Äܽâ¾öÎÊÌ⣬µ«Êǵõ½Ò»Ð©Æôʾ£¬ÒòΪAJAX·¢ËÍÊý¾Ý¶¼ÊDzÉÓÃUTF-8±àÂëµÄ·½Ê½·¢Ë͵ģ¬ËùÒÔÒªÔÚ·þÎñÆ÷¶Ë½øÐбàÂëת»»£¨ÎÒÕâÀïÒ³ÃæÊDzÉÓÃGB2312±àÂëµÄ£¬Èç¹ûÊDzÉÓÃUTF-8µÄ»°Ó¦¸Ã²»»áÓÐÕâ²½µÄÎÊÌ⣩£¬ËùÒÔÎÒÔÚ·þÎñÆ÷¶Ë½øÐÐÁËUTF-8תGB2312£¬
$str=iconv("UTF-8","GB2312",$str);
È»ºó²âÊÔ£¬ÔÚFirefoxÉÏ˳Àû½â¾öÁËÎÊÌ⣬ÒÔΪ´ó¹«¸æ³ÉÁË£¬¿ÉÊÇÔÙµ½IEϲâÊÔ£¬·¢ÏÖIEÓÖ³öÏÖÁËÎÊÌ⣬·þÎñÆ÷¶Ë½ÓÊÕµ½µÄ²ÎÊýûֵ£¬ÕâϾÍÓôÃÆÁË£¬Í»È»¿´µ½·¢ËÍÍ·ÉèÖÃÁËsetRequestHeader("Content-Type","application/x-www-form-urlencoded");£¬¾ÍÕÒµ½ÎÊÌâËùÔÚÁË£¬È»ºó¾ÍÔÚ·¢ËÍÄÇÀï½øÐÐÁ˲ÎÊý±àÂ룺
geturl=encodeURI(geturl);
geturl=encodeURI(geturl); //Á½´ÎÒ²¿ÉÒÔд³Égeturl=encodeURI(encodeURI(geturl));
xmlhttp.open("GET",geturl,true);
È»ºóÔÙµ½·þÎñÆ÷¶Ë½øÐÐURL½âÂ룺
$str=urldecode($str); //½âÂë
$ str =iconv("UTF-8","GB2312",$ str); //±àÂëת»»
×¢Ò⣺½âÂë±ØÐëÔÚ±àÂëת»»Ç°Ã棬²»È»µÃ²»µ½ÕýÈ·Öµ
±£´æ²âÊÔ£¬IEºÍFirefox¶¼ÄÜÕý³£ÁË¡£
µÚ¶þÖÖ¾ÍÊÇ·þÎñÆ÷¶ËÏò¿Í»§¶ËÊä³öÖÐÎÄʱ³öÏÖÂÒÂ룬ÕâÀàÎÊÌâÍøÉϵĴ𰸾ͱȽ϶àÁË£¬Ò²¶¼Äܽâ¾ö£¬ÎªÁ˱ÜÃâ¸÷λÔÙÈ¥²éÕÒ£¬ÎÒÔÚÕâÀï¾ÍCOPYÏÂJ
Ô
Ïà¹ØÎĵµ£º
×î½üÔÚдһ¸ö ǰ̨»ùÓÚ javascript. µÄ¿Í»§¶Ë ·þÎñÆ÷¶ËPHP µÄ·ÖÎöϵͳ¡£
ÔÏȼƻ®Ê¹ÓÃXMLΪÊý¾Ý½»»¥»ù´¡ µ«ÊÇ×îÖÕ»¹ÊÇÑ¡ÓýÏÇáÁ¿¼¶µÄJSON×îΪÊý¾Ý½»»¥»ù´¡¡£
Ê×ÏȽéÉÜjsonµÄ¸ñʽ
json ˵¼òµ¥ÆäʵÊÇÒ»ÖÖÊý¾Ý¸ñʽ ¸ü¼òµ¥µÄ¿ÉÒÔ¿´×ö¼òµ¥µÄÊý×é¡£
ʵÀý £¨Ò»£©
<script>
var jsonArray=[
......
×¼±¸:
lighttpd-1.4.15.tar.gz
php-4.4.2.tar.gz
mysql-5.0.20a.tar.gz
¿ªÊ¼:
1 ±àÒë°²×°lighttpd
# tar zxvf lighttpd-1.4.15.tar.gz
# cd lighttpd-1.4.15
# ls
# ./configure --prefix=/usr/local/lighttpd //´Ë²¿ÎÞ·¨±àÒëʱÌáʾ°²×°prce-devel
#&nbs ......
#
Æô¶¯·þÎñµÄÓû§ºÍ×é
user
lighttpd lighttpd;
#
¿ª¶àÉÙ½ø³Ì
worker_processes
2;
#
´íÎóÈÕÖ¾
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors t ......
Apache °æ±¾£º 2.2
PHP °æ±¾£º5.2.11
EclipseÏÂÔصØÖ·£ºhttp://downloads.zend.com/pdt/all-in-one/zend-eclipse-php-galileo-SR1-win32-x86.zip
½âѹºóÔËÐÐEclipse.exe
Ñ¡Ôñ¹¤×÷¿Õ¼ä
ÎÒÑ¡ÔñÁËE:\PHPworkspace
ÕâʱҪ²åÈëÒ»²½
´ò¿ªApacheµÄÅäÖÃÎļþhttpd.conf
²éÕÒ”DocumentRoot“
ÐÞ¸ÄdocumentrootµÄÖ ......
±¾´ÓÓõÄÊÇZend Debugger
ÔÚµ÷ÊÔcounter1.phpµÄʱºò³öÏÖÁËÂÒÂë´íÎó
ÕÒµ½ÁËÎÊÌâµÄÔÒò
zend debuggerĬÈϵıàÂëΪutf-8
¶øphpµÄĬÈϱàÂ뷽ʽΪgbk
µ±³õÅäÖÃphp¿ª·¢»·¾³ÊÇΪÁ˲¿ÊðdiscuzÂÛ̳
ËùÒÔ¾ÍÉèÖóÉÁËgbk
Õâ±ãÊÇÔÒòÁË
ͳһһÏÂ
¶¼ÓÃutf-8
window-preferences-general-workspace
text-file-encoding: utf-8
......