易截截图软件、单文件、免安装、纯绿色、仅160KB

Ajax异步刷新

注意:
1、<div id="iframe">显示刷新的内容</div>
2、调用异步刷新:javascript:OnLink('地址')
<!--ajax异步刷新-->
<script type="text/javascript">
 //创建XMLHttpRequestc对象
  var  xmlHttp=false;
  //判断浏览器
  function createXMLHttpRequest(){
    if(window.ActiveXObject){//IE浏览器
      try{
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }catch(e){
        try{
          xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }catch(e){}
      }
    }else{//其他浏览器:如mozilla 的 fireFox(火狐) 或者 netscape 7
      xmlHttp=new XMLHttpRequest();
    }
  }
  //提交获得值后的方法
  function OnShow(){
   if(xmlHttp.readyState==4){
       if(xmlHttp.status==200){
         var info=xmlHttp.responseText;
      document.getElementById("iframe").innerHTML=info;
      }
    }
  }
  //要调用的方法
  function OnLink(URL){
   createXMLHttpRequest();
   xmlHttp.open("post",URL,true);
    xmlHttp.onreadystatechange=OnShow;
     xmlHttp.send(null);
  }
 </script>


相关文档:

AJAX中DragPanelExtender扩展控件


页面代码:
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManage ......

Ajax 的状态介绍

在《Pragmatic Ajax A Web 2.0 Primer 》中偶然看到对readyStae状态的介绍,感觉这个介绍很实在,摘译如下:
0: (Uninitialized) the send( ) method has not yet been invoked.
1: (Loading) the send( ) method has been invoked, request in progress.
2: (Loaded) the send( ) method has completed, entire respons ......

ASP.NET 2.0 AJAX中Webservice调用方法

ASP.NET 2.0 Ajax中能够在客户端js中很方便地调用服务器Webservice,以下为一些调用的示例。笔者安装的ASP.NET 2.0 AJAX
版本为AJAX November CTP。
三个示例分别为:
1 带参数的WS方法
2 不带参数的WS方法
3 参数类型为DataTable的WS方法
一、WebMethod
注意要点:
1 WebMethod类需要添加命名空间 Microsoft.Web. ......

AJAX Cross Domain Same Origin Policy limitation

摘自:http://www.ibm.com/developerworks/library/wa-aj-jsonp1/
AJAX Same-Origin Policy(SOP) limitation:
 AJAX prevents cross-domail invokation, there are several ways to by pass this limitation.
1. write a proxy on the server side. The SOP limitation only exists only on the javascript si ......

ajax编程界面布局及界面元素命名体会

1、区块的显示与隐藏
      在进行ajax编程时,经常会用到div标签对页面元素进行布局,大致方法是,把界面分做几大块,有时候需要根据点击菜单显示相应的块及隐藏其他块,这时可简单设置div.style.display为block进行显示,div.style.dispaly为none进行隐藏。
2、界面元素命名
  &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号