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

ajaxÂÒÂë½â¾ö×ܽá


javascriptÑØÓÃjavaµÄ×Ö·û´¦Àí·½Ê½£¬ÄÚ²¿ÊÇʹÓÃunicodeÀ´´¦ÀíËùÓÐ×Ö·ûµÄ£¬
µÚ¶þ£¬utf-8ÊÇÿ¸öºº×Ö£¨unicode×Ö·û£©ÓÃ3¸ö×Ö½ÚÀ´´æ´¢¡£
µÚÈý£¬ÓÃutf-8À´sendÊý¾ÝÊDz»»á³öÏÖÂÒÂëµÄ£¬ÊǺǫ́³ÌÐòûÓÐÕýÈ·½âÂë²Å»á³öÏÖÂÒÂë¡£
µÚËÄ£¬ajax·¢ËÍÊý¾ÝµÄʱºòÈç¹ûÐÞ¸Ä Content-Type Ϊ application/x-www-form-urlencoded"£¬¿Ï¶¨ÊÇÓÃpost·½Ê½£¬¶ø“Ì«´óµÄÊý¾ÝÍùÍù»á³ö´í”ÊÇÓÃGET·½Ê½·¢ËÍÊý¾ÝÔì³ÉµÄ¡£
µÚÎ壬ÓÃvbscriptдµÄº¯ÊýÊÇÓÃÀ´°ÑÊý¾Ýת³Égbk±àÂ루²Ù×÷ϵͳĬÈϵıàÂ뷽ʽ¡£Èç¹ûÔÚ·±ÌåϵͳÉϾÍÊÇbig5Ö®ÀàµÄ±àÂ룩µÄ£¬¶ø²»ÊÇgb2312£¬Á½ÕߵıàÂë×Ö·ûÊýÁ¿Ïà²î3±¶×óÓÒ¡£
µÚÁù£¬ÓÃcookieÀ´·¢ËÍÊý¾Ý£¬Ò»ÊǺÜÈÝÒ×Òç³ö£¬¶þÊÇÒª²»Í£µÄ²Áƨ¹É£¬·ñÔòcookieÀïÃæµÄÊý¾ÝÔÚÿ¸öhttpÇëÇ󣨰üÀ¨Í¼Æ¬ºÍ½Å±¾ÇëÇó£©Öж¼»á±»·¢ËÍ¡£ÈýÊDz¢·¢¼¸¸öhttpÇëÇóµÄʱºò£¬Ã»Óа취ָ¶¨ÄǸöcookieÊÇÒª·¢Ë͸øÄǸöhttpÇëÇóµÄ¡£
------------------------
ÓÃAJAX
À´GET»ØÒ»¸öÒ³Ãæʱ£¬RESPONSETEXTÀïÃæµÄÖÐÎĶà°ë»á³öÏÖÂÒÂ룬ÕâÊÇÒòΪxmlhttpÔÚ´¦Àí·µ»ØµÄresponseTextµÄʱºò£¬ÊÇ°Ñ
resposeBody°´UTF-8±àÂë½ø½âÂ뿼Ðγɵģ¬Èç¹û·þÎñÆ÷ËͳöµÄȷʵÊÇUTF-8µÄÊý¾ÝÁ÷µÄʱºòºº×Ö»áÕýÈ·ÏÔʾ£¬¶øËͳöÁËGBK±àÂëÁ÷µÄʱºò¾Í
ÂÒÁË¡£½â¾öµÄ°ì·¨¾ÍÊÇÔÚËͳöµÄÁ÷ÀïÃæ¼ÓÒ»¸öHEADER£¬Ö¸Ã÷ËͳöµÄÊÇʲô±àÂëÁ÷£¬ÕâÑùXMLHTTP¾Í²»»áÂÒ¸ãÁË¡£
PHP:header(''Content-Type:text/html;charset=GB2312'');
//ASP:Response.Charset("GB2312")
ASP:Response.Charset="GB2312"
JSP:response.setHeader("Charset","GB2312");
·½·¨Ò» (ÕâÖÖ·½·¨²»Ôõô¿É¿¿)
Ïò·þÎñÆ÷·¢ËÍÇëÇó£¬ÔÚ·þÎñÆ÷¶Ë¼ÓÈ룺
¡¡¡¡String string = request.getParmater("parmater");
string = new String(string.getBytes("ISO8859-1"),"GBK");
·þÎñÆ÷Ïò¿Í»§¶Ë·¢Ëͱ¨ÎÄ£º
String static CONTENT_TYPE = "text/html;charset=GBK";
¡¡¡¡response.SetContentType(CONTENT_TYPE);
·½·¨¶þ (²»ÍƼöʹÓÃ,URLDecoder.decode()ÓëÐÂä¯ÀÀÆ÷²»¼æÈÝ)
Ajax POST ÖÐÎÄÂÒÂë½â¾ö
¿´Á˺öàƪÎÄÕÂ,×îÖÕ»¹ÊÇ¿´µ½Ò»Æª,½â¾öÁË×Ô¼ºµÄÎÊÌâ.
ajaxpost.js
var myRequest; // Variable to hold request object
function mysubmit()...{
if (window.XMLHttpRequest)
...{
myRequest = new XMLHttpRequest(); // Standards-compliant browsers
} else if


Ïà¹ØÎĵµ£º

Ajax¿çÓò·ÃÎÊ·½·¨´óÈ«

Case I. Web´úÀíµÄ·½Ê½ (on Server A)
¼´Óû§·ÃÎÊAÍøվʱËù²úÉúµÄ¶ÔBÍøÕ¾µÄ¿çÓò·ÃÎÊÇëÇó¾ùÌá½»µ½AÍøÕ¾µÄÖ¸¶¨Ò³Ã棬ÓɸÃÒ³Ãæ´úÌæÓû§Ò³ÃæÍê³É½»»¥£¬´Ó¶ø·µ»ØºÏÊʵĽá¹û¡£´Ë·½°¸¿ÉÒÔ½â¾öÏֽ׶ÎËùÄܹ»Ïëµ½µÄ¶àÊý¿çÓò·ÃÎÊÎÊÌ⣬µ«ÒªÇóAÍøÕ¾ÌṩWeb´úÀíµÄÖ§³Ö£¬Òò´ËAÍøÕ¾ÓëBÍøÕ¾Ö®¼ä±ØÐëÊǽôÃÜЭ×÷µÄ£¬ÇÒÿ´Î½»»¥¹ý³Ì£¬AÍøÕ¾µÄ· ......

ajaxѧϰ¼

ÓйØajaxµÄÆäʵ¾ÍÊÇ1¸öÀàµÄʹÓÃ:XMLHttpRequest.
Ê×ÏÈÒªÉùÃ÷Õâ¸öÀàµÄ¶ÔÏ󣬼øÓÚ¸÷¸öä¯ÀÀÆ÷°ÑÕâ¸öÀàǶÈëµÄ·½Ê½²»Í¬£¬ÉùÃ÷µÄ·½Ê½Ò²²»Í¬£º
  var xmlHttpReq = null;
if (window.XMLHttpRequest) //Mozilla ä¯ÀÀÆ÷
{
¡¡¡¡¡¡ xmlHttpReq = new XMLHttpRequest();
¡¡¡¡}
¡¡ else if (window.ActiveXObject) // ......

AJAXÀà

 AJAXÀà
// AJAXÀà
function AJAXRequest() {
var xmlObj = false;
var CBfunc,ObjSelf;
ObjSelf=this;
try { xmlObj=new XMLHttpRequest; }
catch(e) {
try { xmlObj=new ActiveXObject("MSXML2.XMLHTTP"); }
catch(e2) {
try { xmlObj=new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e ......

php ajax debug method make log in a text file

log into file
//
ob_start();
echo "<pre>";
print_r($data);
echo "</pre>";
$a=ob_get_contents();
//DAL::remove("insert into mytest(vvv) values('$a')");
$filename = "file.txt";
$file = fopen($filename, "w") ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ