惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Latest news
Latest news
T
The Exploit Database - CXSecurity.com
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
B
Blog
T
Threat Research - Cisco Blogs
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
P
Palo Alto Networks Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
B
Blog RSS Feed
Scott Helme
Scott Helme
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
W
WeLiveSecurity

博客园 - SOSOS's BLog

[转]视图多表 asp.net mvc3.0 在EF Code-First中自定义Model跟数据库中的表名、字段名的对应关系 征懂IOS开发的同仁,联系QQ 755414 Web前端研发工程师 泛型数据生成Excel Unicode To ASCII,改写至Js ExtJs Extender Controls 3.2.0 截图及下载 多余的项目外包,可长期合作.深圳的朋友(已结束,谢谢支持) webservice小解 介绍一种查找网站被上传的恶意文件的方法 2G空间免费使用,只要你有站 08年又快结束了..抱怨下!~ 基础知识要牢固..复习复习,再复习 今天去面试.net开发,感想 淘宝"新版"首页 样式在.net下测试不成功.附解决办法 在b/s开发中经常用到的javaScript技术 学习.net2.0的网站 网站广告不再影响你网站速度的代码
Ajax技术简单入门
SOSOS's BLog · 2006-02-12 · via 博客园 - SOSOS's BLog

随着Google公司推出的Gmail服务后,越来越多的人开始关注Ajax技术了,所谓Ajax(Asynchronous JavaScript and XML缩写)技术,就是指运用JavaScript和XML在不用刷新Web页的情况下与Web服务器通信的技术.
一般来说,使用Ajax技术主要有两个原因:一是fast;二是cool。
下面通过一个示例来说明Ajax的使用:
1.HTML代码
btn1用来调用Ajax代码(请求服务器并将返回信息填充到select1里)。

1 <select id="select1">select>
2 <input id="btn1" value="Fill Select" type="button" onclick="getOptions();">

2.JavaScript代码调用Ajax

 1// Create the Request object (the AJAX wrapper)
 2var request = new Request();
 3// Change this to fit your environment
 4var url = "http://localhost/ajax/";
 5function getOptions()
 6{
 7    // Call the AJAX
 8    // Notice the second parameter is actually a function to handle the response
 9    request.GetNoCache(url + "requests/getOptions.aspx",
10    function(result)
11    {
12        if (result.readyState!=ReadyState.Complete)
13            return;               
14        if (result.status==HttpStatus.OK && result.responseText != "")
15        {
16            // If the request was successfull and returned data
17            var vals = result.responseText.split("~");
18            for (i=0; i<vals.length; i++)
19            {
20                var pair = vals[i].split("|");
21                var op = new Option(pair[1], pair[0], falsefalse);
22                var sel = document.getElementById("select1");
23                sel.options[sel.length] = op;
24            }

25            alert("Remember that the new values in form" + 
26                  " element 'select1' are not in viewstate." + 
27                  " Code appropriately.");
28        }

29        else
30        {
31            // Handle the failure condition
32            alert('Get options failed.');
33        }

34    }

35    )
36}

3.aspx文件

1 <%@ Page language="c#" Codebehind="getOptions.aspx.cs" AutoEventWireupo="false" Inherits="ajax.requests.getOptions" %>
2 <%=result%>

4.codebehind代码

1protected string result = string.Empty;
2private void Page_Load(object sender, System.EventArgs e)
3{
4    for (int i=0; i<10; i++)
5    {
6        result += i.ToString() + "|option " + i.ToString() + "~";
7    }
8    result = result.Substring(0, result.Length - 1); // to drop the last '~'
9}

更多Ajax
下载:源文件 项目测试