日期:2014-05-17 浏览次数:20897 次
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script>
function check(f) {
var xml = '<?xml version="1.0" encoding="UTF-8" ?><auth><email>' + f.email.value + '</email><password>' + f.password.value + '</password></auth>';
$.ajax({ url: '动态页地址',
type: 'POST',
data: 'data=' + encodeURIComponent(xml),
dataType: 'xml',
success: function (xmlDoc) {
var retCode = $(xmlDoc).find('retCode').text();
alert(retCode);
},
error: function (xhr) { alert('发生错误!\n' + xhr.responseText); }
});
return false;
}
</script>
</head>
<body>
<form onsubmit="return check(this)">
<INPUT name=email class="inp" id="text" size=15 maxLength=40>
<INPUT name=password type=text1 class="inp" id="text1">
<input type="submit" value="submit"&