Myeclipse+Ajax 例子
一个MyEclipse里的AJAX例子2008-03-19 19:53本例将在页面的参数以Get和POST两种方式传递到服务器,并回显到页面; 本例共包括两个主要文件getAndPostExample.html和GetAndPostExample.java以及一个配置文件web.xml 建立文件的步骤: 1.在Eclipse新建一个web project-->ajax1 2.在ajax1里面新建一个getAndPostExample.html 3.在ajax1里面新建一个servlet-->GetAndPostExample.java getAndPostExample.html如下
This is the description of my J2EE component This is the display name of my J2EE component GetAndPostExample com.ajax1.GetAndPostExample GetAndPostExample /GetAndPostExample index.jsp 在这个简单的AJAX的例子里getAndPostExaple.html负责表单参数的输入和传递,而servlet GetAndPostExample.java负责在服务器端接受参数。参数传递时加的时间戳是保证URL的唯一性。
相关文档:
打开请求
有了要连接的 URL 后就可以配置请求了。可以用 XMLHttpRequest 对象的 open() 方法来完成。该方法有五个参数:
request-type:发送请求的类型。典型的值是 GET 或 POST,但也可以发送 HEAD 请求。
url:要连接的 URL。
asynch:如果希望使用异步连接则为 true,否则为 false。该参数是可选的,默认为 true。
......
ashx文件是.net 2.0新加的文件类型(其实在.net 1.0下已经可用,但是没有公开提供).
ashx文件和aspx文件有什么不同? 我们先新建一个ashx文件看看:
ashx
<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
public class Handler : IHttpHandler {
public void Process ......
把自己写的jquery写下来
比如现在有一个界面,分左右两侧,当点击左侧的标签,然后在右侧框显示,实现无刷新技术,这是最简单的ajax应用
function touser() {
$.ajax({
url: "UserTable.aspx?timeStamp=" + new Date().getTime(),
success: function(msg) {
$("#ma ......
初学BSP, 一直在想如何实现AJAX效果, 起到无意看到这篇网文, 才有一种惑然开朗的感觉, 亏我还过ASP/ASP.net , 真是做了几年ABAP做傻了,呵呵
其实BSP和ASP很象, 可以采用ASP的方法来实现AJAX应用, 无非是调用xmlHttpRequest对象而己.
原文地址: http://scnblogs ......