加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Kissy中的ajax异步提交

发布时间:2020-12-16 00:32:43 所属栏目:百科 来源:网络整理
导读:参考文献 http://docs.kissyui.com/1.1.6/ajax/ var S=KISSY; S.io({ type:'POST', url:'interface.jsp', data:null, success:function(data,textStatus,xhr) { //callback }, dataType:'xml' }); 比如兴哥在user中的regist下的 S.Event.on('#submit','click
参考文献 http://docs.kissyui.com/1.1.6/ajax/
var S=KISSY;
S.io({
type:'POST',
url:'interface.jsp',
data:null,
success:function(data,textStatus,xhr)
{
//callback
},
dataType:'xml'
});
比如兴哥在user中的regist下的
S.Event.on('#submit','click',function()
{
new IO(
{
url:"{path}/user/confirmRegist.do",
data:
{
email:S.all('#email').val(),
username:S.all('#username').val()
},
type:'get',
dataType:'json',
success:function(data)
{
if(!data.isCanRegist)
{
alert(data.error);
}
}
}) ;
});





像现在我们想在当点击确定这个button的时候进行一个Ajax异步的提交,那么我们需要找到后台的脚本,进行一个new IO
首先我们找到这个脚本





当点击的时候已经绑定了一个函数,接着我们进行编码、


_event.on(_enter,"click",function (S) {
//TODO 2014-05-30 basilwang need to submit
// _dom_id_J_FForm.submit();
new IO(
{
type:'Get',
url:"/JavaWebFrame/sports/index.do",
data:
{
step:7000
},
//dataType:'json',
success:function(data)
{
alert("success");
}
});



_event.on(_enter,
success:function(data)
{
alert("success");
}
});







回调函数显示成功,具体需要在后台进行参数的配置,controller中的方法的完善。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读