导航

闲谈

« ajax定义:搭建第一个ajax页面Microsoft Sqlserver 2005的广告 »

xmlhttp的请求同步和异步、方法的get和post

看看open方法的另外几个参数。

.open http-method, url, async, userID, password (后面是帐号和密码,在禁止匿名访问的http页面中,需要用户名和口令)

首先看看异步处理方式。

其中async是一个布尔值。如果是异步通信方式(true),客户机就不等待服务器的响应;如果是同步方式(false),客户机就要等到服务器返回消息后才去执行其他操作。我们需要根据实际需要来指定同步方式,在某些页面中,可能会发出多个请求,甚至是有组织有计划有队形大规模的高强度的request,而后一个是会覆盖前一个的,这个时候当然要指定同步方式:Flase。

//niceidea 签名留念

首先看看method,方法。

一个标准的http请求头:

7/8/99 10:27:16 Sent GET /Store/Download.asp HTTP/1.1

       Accept: application/msword, application/vnd.ms-execl, application/vnd.ms-

       powerpoint, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-

       comet, */*

       Accept-Language: en-us

       Encoding: gzip, deflate

       Referer: http://ww.wrox.com/main_menu.asp

       Cookie: VisitCount=2&LASTDATE=6%2F4%2F99+10%3A10%3A13+AM

       User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)

       Host: 212.250.238.67

       Connection: Keep-Alive

很容易看懂,其中的method包括post/get/put等。对应的主要是对于form即表单元素的处理方法。

当mothod值为get时,表单将附加在action页面的url中;如果页面是asp的,将会request.querystring中获得;

如果是post,将会在request.form中获得,

对应与put方法的表单写法是:form method="POST" enctype='multipart/form-data'

主要用于上传文件。

使用那种方法取决于服务端。例如前面的:在xmlhttp中传递cookie和表单数据

  • 相关文章:
  • quote 4.周明明
  • http://www.qdjtd.cn
  • 人生不在于机会而在于选择。人生的命运就取决于一刹那所做的决定。 自己可以主宰自己的命运wow gold,下定决心争取过自己想要的生活。清楚自己的生活目的。我们需要拥有自己的梦想。
  • 2006-4-14 11:40:40 回复该留言
  • quote 16.翻译
  • <a href="http://blog.yam.com/jiayinte" target="_blank">翻译</a>
    <a href="http://blog.yam.com/jiayinte" target="_blank">翻译公司</a>
    <a href="http://blog.yam.com/jiayinte" target="_blank">北京翻译公司</a>
    <a href="http://jiayinte.bokee.com" target="_blank">翻译公司</a>
    <a href="http://jiayinte.yculblog.com" target="_blank">翻译公司</a>
    <a href="http://www.blogcn.com/u/60/43/jiayinte/index.html" target="_blank">翻译公司</a>
    <a href="http://jiayinte.blogbus.com/index.html" target="_blank">翻译公司</a>
    <a href="http://jiayinte.bloglong.com" target="_blank">翻译公司</a>
    <a href="http://blog.donews.com/jiayinte" target="_blank">翻译公司</a>
    <a href="http://jiayinte.tianyablog.com/" target="_blank">翻译公司</a>
    <a href="http://blog.freshwired.net/index.php?name=jiayinte" target="_blank">翻译公司</a>
    <a href="http://blog.iky.cn/jiayinte/" target="_blank">翻译公司</a>
    <a href="http://jiayinte.lanyue.com" target="_blank">翻译公司</a>
  • 2006-6-29 9:59:30 回复该留言
  • quote 17.翻译
  • <a href="http://www.jiayinte.cn" target="_blank">翻译公司</a>
    <a href="http://www.jiayinte.net/fygs/" target="_blank">翻译</a>
    <a href="http://www.jiayinte.net/fygs/" target="_blank">翻译公司</a>
    <a href="http://www.jiayinte.net/fyjd/" target="_blank">翻译</a>
    <a href="http://www.jiayinte.net/fyjd/" target="_blank">翻译公司</a>
    <a href="http://www.jiayinte.net/sn/="_blank"> 翻译公司</a>
    <a href="http://www.jiayinte.cn" target="_blank">北京翻译公司</a>
    <a href="http://www.jiayinte.cn" target="_blank"> 上海翻译公司 </a>
    <a href="http://www.jiayinte.com" target="_blank">翻译</a>
    <a href="http://www.jiayinte.com" target="_blank">翻译公司</a>
    <a href="http://www.jiayinte.cn" target="_blank">翻译公司上海 </a>
    <a href="http://www.jiayinte.cn" target="_blank">翻译公司北京</a>
  • 2006-6-29 9:59:56 回复该留言

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Search

控制面板

最新评论及回复

最近发表