Ajax异步提交,这个我大概知道,就是在server发来响应之前这段时间无须傻等,可以继续执行用户其他操作。
但是网上还说有第二种提交方式:form表单提交。form提交与Ajax是并列的?之前看到过这种使用方法:
在
a.xsl
<?xml version = "1.0" encoding = "gb2312"?>
<xsl:stylesheet version = "1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/">
<script type = "text/javascript" language = "javascript" src = "A.js">
</script>
<form id = "form1" name ="form1" target = "FrmSubmit" onsubmit = "return OnSubApply(this)" method = "post">
<input type = "text" class = "textbox" id = "time1" style = "width:400"/>
<input type = "text" class = "textbox" id = "time2" style = "width:400"/>
<input name ="ApplyButton" value = "提交" id = "ApplyButton" type = "submit" class = "buttonX"/>
<input name ="CancleButton" value = "取消" id = "CancleButton" type = "button" class = "buttonX" onclick = "OnCancleButton()"/>
</form>
<xsl:call-template name = "xx">
</xsl:call-template>
<form id = "form1" name ="form1" onsubmit = "" method = "post">
<xsl:call-template name = "yy">
</xsl:call-template>
</form>
<iframe id = "TABchange" name = "TABchange" scrolling = "yes" src = "A.html">
</iframe>
</xsl:template>
A.js
function OnCancleButton()
{
return false;
}
function fuc1()
{
XXXXXXXXXXX;
}
function OnSubApply(this)
{
time01 = document.getElementById("time1").value;
time01 = document.getElementById("time1").value;
oRequest = new XmlRequest;
oRequest.add(TIME1, time01);
oRequest.add(TIME2, time02);
Frame.Ajax.send("/wcn/mco.x?", oRequest,fuc1, {bProcErroe: true});
}
问题:
1、xsl里的form用的是Ajax提交?
2、Ajax无刷新提交为啥这里没有体现呢?因为我点击“提交”以后页面还是会刷新的
3、url提交和href提交还有form提交、Ajax提交。。。到底哪儿跟哪儿啊!
URL
Ajax
XSL