AjaxµÇ¼ÎÊÌâ - Web ¿ª·¢ / Ajax
±¾È˶ÔASPÒ»Çϲ»Í¨£¬ÓÉÓÚÁÙʱÐèÒªÓÃWEBµ½µÇ¼£¬ËùÒÔÓдËÒ»ÎÊÇë´ó¼Ò¼ûÁ£º
ÔÚÍøÉÏÕҵĴúÂ룬ÊÇAjax¡¢ASP¼ÓACCESSµÇ¼µÄÀý×Ó£¬µ«ÊÇһֱûµ÷ͨ£¬Ò»¹²ÓÐÎå¸öÎļþindex.html¡¢adoconn.asp¡¢checkuser.asp¡¢reg.aspºÍusername.mdb£º
index.htmlÄÚÈÝÈçÏ£º
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Óû§×¢²á-codefans.net</TITLE>
</HEAD>
<style>
<!--
body,td {font-size:12px;}
input{background-color: #ffffff; color: #000000; font-family: tahoma; font-size: 12px; border: 1px #cccccc double}
-->
</style>
<BODY>
<script language=javascript>
<!--
function checkUserName()
{
username=document.getElementById("username").value;
var xmlhttp;
try
{
xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
try
{
xmlhttp=new XMLHttpRequest();
}
catch (e)
{
}
}
}
if (username=="")
{
msg="Óû§Ãû²»ÄÜΪ¿Õ";
var ch=
Ïà¹ØÎÊ´ð£º
ÎÒÏÖÔÚÓÃstruts2¿ò¼Ü,ÐèҪʹÓÃajaxʵÏÖ¾Ö²¿Ë¢Ð£¬µ«ÊÇ´ÓÈÝÆ÷Àï·µ»ØµÄÖµ²»ÖªµÀÔõô´Óstruts.xmlÅäÖÃÎļþÀïÓ³Éäµ½jspÒ³ÃæÀÒÔÇ°servletÀïдout.orint("xxxxx")¾Í¿ÉÒԵõ½~£¬µ«ÊÇÏÖÔÚÓÃstruts¾Í²»ÖªµÀÔõôР......
ÎÒJSPµÄÒ³ÃæÊÇ£º
<%@ page language="java" contentType="text/html; charset=gb2312"
%>
<script>
function Save(){
xmlHttp=GetXmlHttpObject()
if(xmlHttp==nul ......
ÎÒÓÃjqueryÎÞË¢ÐÂÉÏ´«Í¼Æ¬ºó·µ»Øjson¸ñʽµÄÊý¾Ý±¨´í
£¨Êµ¼ÊÉÏͼƬÊÇÉÏ´«³É¹¦µÄÁË£¬Ö»ÊÇ·µ»Øjson¸ñʽ×ܶÁ²»µ½£¬×ÜÊDZ¨´í£©
ÎÒµ÷ÊÔÉÏ´«µÄashxÒ³ÈçÏÂ
ÎÞ·¨ÏÔʾ XML Ò³¡£
ʹÓà Ñùʽ±íÎÞ·¨²é¿´ XML ÊäÈë¡£Çë¸ü ......
´úÂëÖУ¬Èç¹û½«//alert(1)¡¡×¢ÊÍ´ò¿ª£¬ÄÇô¾Í¿ÉÒÔµ÷Óã¬Èç¹û×¢Ê͵ô¾ÍÎÞ·¨µ÷ÓÃ
»³ÒÉÊǵ¼JSÎļþ³öÎÊÌâÁË£¬ÒòΪд¹ýjspÒýÁ½¸öJSÎļþûÎÊÌ⣬
¶øJSPÒýÒ»¸öJSÎļþ£¬Õâ¸öJSÒý±ðÍâµÄJSÎļþ³öÏÖÏÂÃæÎÊÌ⣬ÉÏÍøÕÒÁË°ëÌìû½á ......
´úÂëÈçÏ Çë¸ßÊÖ Ö¸µãÏ лл
ajax_http.js
-------------
function getXMLHTTP() {
var xmlhttp;
if (window.ActiveXObject) {
//IE
try {
......