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

jQuery AJAX的5种实现方式

What is AJAX
This section is for those who have no idea what AJAX is. If you don’t fall into this category, feel free to skip to the next section.
AJAX stands for asynchronous JavaScript and XML. If you see another term XHR, which is shorthand for XML HTTP request, it’s the same thing. Don’t be afraid of this jargon; AJAX is not rocket science.
In Gmail, switch from inbox to draft. Part of the page is changed, but the page is not refreshed. You remain on the same page. Url has not changed (except for the #draft at the end of the url, but that’s still the same webpage).
In Google Reader, select a feed. The content changes, but you are not redirected to another url.
In Google Maps, zoom in or zoom out. The map has changed, but you remain on the same page.
The key to AJAX’s concept is “asynchronous”. This means something happens to the page after it’s loaded. Traditionally, when a page is loaded, the content remains the same until the user leaves the page. With AJAX, JavaScript grabs new content from the server and makes changes to the current page. This all happena within the lifetime of the page, no refresh or redirection is needed.
Caching AJAX
Now we should know what AJAX actually is. And we know that, when Gmail refreshes some content without redirection, an AJAX call is made behind the scenes. The requested content can either be static (remains exactly the same all the time, such as a contact form or a picture) or dynamic (requests to the same url get different responses, such as Gmail’s inbox where new mails may show up any time).
For static content, we may want the response cached. But for dynamic content, which can change in a second’s time, caching AJAX becomes a bug, right? It should be noted that Internet Explorer always caches AJAX calls, while other browsers behave differently. So we’d better tell the browser explicitly whether or not AJAX should be cached. With jQuery, we can


相关文档:

DIV层显示登录窗口 模拟ajax窗口

function ScreenConvert()
{
var browser = new Browser1();
var objScreen = document.getElementById("ScreenOver");
if(!objScreen)
var objScreen = document.createElement("div");
var oS = objScreen.style;
objScreen.id = "ScreenOver";
oS.display = "bloc ......

从零开始学习jQuery (六) AJAX快餐

一.摘要
本系列文章将带您进入jQuery的精彩世界, 其中有很多作者具体的使用经验和解决方案,  即使你会使用jQuery也能在阅读中发现些许秘籍.
本篇文章讲解如何使用jQuery方便快捷的实现Ajax功能.统一所有开发人员使用Ajax的方式.
二.前言
Ajax让用户页面丰富起来, 增强了用户体验. 使用Ajax是所有Web开发的必修课. ......

一个关于javascript Ajax解析XML的原始实例

        该实例首先需要创建数据库,数据库Test唯一表test,该表具有三个列分别为c1,c2,c3, int型,请自行建立数据库并插入几行测试数据。
        然后我们希望能将数据库中的数据读取出来,我在此处只是将数据库数据以数据集的方式存放在本地中, ......

jquery ajax return值不能取得的解决方案

大家先看一段简单的jquery ajax 返回值的js
代码
function getReturnAjax{
  $.ajax({
    type:"POST",
    url:"ajax/userexist.aspx",
    data:"username="+vusername.value,
    success:function(msg){
&nb ......

jQuery ajax调用示例

   我在上一篇文章中使用原始javascript的方式构造ajax调用,但从全局看,不仅仅代码的阅读性比较低而且隐藏发生错误的可能,比如在页面加载时就改变dom结构,还要时刻关注浏览器的兼容性,而使用jQuery我们将不存在类似的问题,代码的可读性也显著提高,代码量小,下面是jQuery版本的js部分代码,希望能够对读者 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号