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
相关文档:
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 ......
如何在 sharepoint里面 使用ajax 和 ajaxtoolkit 这个问题我之前去百度和Google个多次!基本上都是说的修改站点下面的配置文件!嘿嘿当然我这里也是修改配置文件!
下面是我在msdn提的问题这个问题! 按照微软里面人员说的步骤配置
http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/2d63d004-ef0 ......
原文地址:http://hi.baidu.com/zhangqiuxi/blog/item/3d0206a84bbd72bbcb130cab.html
这篇文章说明 AJAX 相关技术的基础,并提供实例供您上手。
第一步 – 说声「请」 (又称为「怎么发出 XMLHttpRequest」)
为 了用 JavaScript 对服务器发送 HTTP 要求,你必须先以相关的类别(class)制出实体(instance)。Int ......
大家先看一段简单的jquery ajax 返回值的js
代码
function getReturnAjax{
$.ajax({
type:"POST",
url:"ajax/userexist.aspx",
data:"username="+vusername.value,
success:function(msg){
&nb ......
最近被这个问题困惑了一段时间
问题的由来是这样的:
在pageload事件中,有一行语句对this.Title赋值: this.Title = dir.name;
由dir的name去动态的生成网页的title
这么做并没有什么问题,但是一旦结合了ajax,问题就出现了
有兴趣的朋友可以尝试一下
在pageload中对this.Title赋值,然后在body中写一个updatepanel ......