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

Ajax(ÅжÏä¯ÀÀÆ÷´´½¨XMLHttpRequest¶ÔÏó)

<script type="text/javascript">
function ajaxFunction()
{
var xmlHttp
;

try
    {
   // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
catch (e)
    {
  // Internet Explorer
   try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
   catch (e)
      {
      try
         {
         xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
         }
      catch (e)
         {
         alert("ÄúµÄä¯ÀÀÆ÷²»Ö§³ÖAJAX£¡");
         return false;
         }
      }
    }
}
</script>
Ê×ÏÈÉùÃ÷Ò»¸ö±£´æ XMLHttpRequest ¶ÔÏóµÄ xmlHttp ±äÁ¿¡£
È»ºóʹÓà XMLHttp=new XMLHttpRequest() À´´´½¨´Ë¶ÔÏó¡£ÕâÌõÓï¾äÕë¶Ô Firefox¡¢Opera ÒÔ¼° Safari ä¯ÀÀÆ÷¡£¼ÙÈçʧ°Ü£¬Ôò³¢ÊÔÕë¶Ô Internet Explorer 6.0+ µÄ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")£¬¼ÙÈçÒ²²»³É¹¦£¬Ôò³¢ÊÔÕë¶Ô Internet Explorer 5.5+ µÄ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")¡£
¼ÙÈçÕâÈýÖÖ·½·¨¶¼²»Æð×÷Óã¬ÄÇôÕâ¸öÓû§ËùʹÓõÄä¯ÀÀÆ÷ÒѾ­Ì«¹ýʱÁË£¬Ëû»òËý»á¿´µ½Ò»¸öÉùÃ÷´Ëä¯ÀÀÆ÷²»Ö§³Ö AJAX µÄÌáʾ¡£


Ïà¹ØÎĵµ£º

MVC Json Ajax ¶þ¼¶ ¼¶Á¬

<script type="text/javascript">
$(document).ready(function() {
$("#teamName").change(function() {
$.getJSON('/team/SelectProduct', { teamName: $("#teamName").val() }, function(data) {
$("#productID").empty();


......

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


javascriptÑØÓÃjavaµÄ×Ö·û´¦Àí·½Ê½£¬ÄÚ²¿ÊÇʹÓÃunicodeÀ´´¦ÀíËùÓÐ×Ö·ûµÄ£¬
µÚ¶þ£¬utf-8ÊÇÿ¸öºº×Ö£¨unicode×Ö·û£©ÓÃ3¸ö×Ö½ÚÀ´´æ´¢¡£
µÚÈý£¬ÓÃutf-8À´sendÊý¾ÝÊDz»»á³öÏÖÂÒÂëµÄ£¬ÊǺǫ́³ÌÐòûÓÐÕýÈ·½âÂë²Å»á³öÏÖÂÒÂë¡£
µÚËÄ£¬ajax·¢ËÍÊý¾ÝµÄʱºòÈç¹ûÐÞ¸Ä Content-Type Ϊ application/x-www-form-urlencoded"£¬¿Ï¶ ......

ͨÍùajaxµîÌõÄÈ볡ȯ ¡¶ajax¼¼Êõ»ù´¡¡·

      Ñо¿ajaxÒ²Óм¸ÄêµÄʱ¼äÁË£¬¿´¹ýµÄ¼¼ÊõÎĵµÒ²ÊDz»¼ÆÆäÊýÁË£¬
¸÷ÀàµÄÊé¼®Ò²Óм¸±¾£¬ÏÖÔÚ×îÈȵĹÀ¼Æ¾ÍÊÇÄDZ¾<<Õ÷·þAJAX>>£¬
²»¹ýÎÒ²»½¨Òé³õѧÕßÀ´¿´Õâ±¾Ê飬ԭÒò¾ÍÊÇÉÏÊÖ²»ÈÝÒ×£¬Ð´ÊéµÄÈË
ÊÇÎ÷°²Ä³µç×Ó´óѧµÄÒ»¸öÑо¿Éú£¨ÏÖÔÚÔÚIBM¹¤×÷£©£¬¿ª·¢ÁËÒ»¸öblog
²¢ÔËÓÃÁËajax¼¼Êõ£¬ ......

Ajax¿ò¼Ü¸ÅÊö ÄÏÈý·½

Ajax¿ò¼Ü½éÉÜ
¡¡¡¡µ½´ËΪֹ£¬Äã¿ÉÄÜÒѾ­×¢Òâµ½£¬Ê¹ÓÃAjax±à³ÌʱÓкܶàÂ鷳ʡ£Èç¹ûÄãÒªÖ§³Ö¶à¸öä¯ÀÀÆ÷£¨ÏÖÔÚ»¹ÓÐË­Ö»Ö§³ÖÒ»¸öä¯ÀÀÆ÷ÄØ£¿£©£¬ÎÞÒÉ»áÔâÓö²»¼æÈÝÎÊÌâ¡£µ¥¿´Ò»¸ö¼òµ¥µÄ¶¯×÷£¬±ÈÈç˵´´½¨XMLHttpRequest¶ÔÏóµÄÒ»¸öʵÀý£¬ÕâÐèÒªÏȽøÐÐä¯ÀÀÆ÷²âÊÔ¡£Ò»µ©¿ªÊ¼³¢ÊÔʹÓÃAjax¼¼Êõ£¬ÄãºÜ¿ì¾Í»á×¢Òâµ½Òª·´¸´µØÍê³ÉͬÑùµÄÒ» ......

×î¼òµ¥µÄAjaxÈëÃÅÀý³Ì

<?php
if(isset($_GET['do']) && $_GET['do']==='ajax')
{
exit("{msg:'Hello World!'}");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ