struts2+jquery
时间:2009-03-24
来源:互联网
比如添加一张表单,然后数据通过action后,返回一些反馈信息,
然后再显示在这个表单指定的位置。
谢谢呀
作者: xuganggogo 发布时间: 2009-03-24
听你的意思是: jquery 和 struts2 要整合的意思?
作者: wangyongshan 发布时间: 2009-03-24
http://cwiki.apache.org/S2PLUGINS/json-plugin.html
楼主这类情况我建议使用DWR而不是通过Action来处理
作者: gordianyuan 发布时间: 2009-03-24
struts2的ajax标签实在不怎么样,就想用jquery整出一套来。
看网络上,还是有用struts2和jquery的,但是实例不多。所以来请求帮助啊 呵呵
作者: xuganggogo 发布时间: 2009-03-24
但我没试过不知道效果怎样
有兴趣楼主可以试试
http://code.google.com/p/s2jquery/
作者: gordianyuan 发布时间: 2009-03-25
好像資源很少
作者: xuganggogo 发布时间: 2009-03-25
原文如下
Don't use that one--it's not going to be developed and I'll remove it from Google Code. We (where I worked) ended up using straight JavaScript with jQuery.
There were too many issues to make it worth the effort--we were being very accessibility and unobtrusive-JavaScript oriented; a good tag-based JavaScript solution needs to collect and inject JavaScript in the response outside of the main HTML (as well as a few other games) so it just wasn't a good path for us.
As Wes said there's a new quasi-official (for now) jQuery plugin. Personally I'd skip tag-based solutions altogether, but in some circumstances it might be all you'd need.
作者: gordianyuan 发布时间: 2009-03-25
但是ajax只能执行一次。要如何清除缓存啊?
作者: xuganggogo 发布时间: 2009-03-25
作者: gordianyuan 发布时间: 2009-03-25
<script type="text/javascript" >
$(document).ready(function(){
$("#submit").click(function(){
alert(new Date());
var t = $("#check").val();
var time = new Date();
$.ajax({
url :'JsonPlugin.action' , //后台处理程序
type:'post', //数据发送方式
dataType:'json', //接受数据格式
cache:false,
data:{check:t}, //要传递的数据
success:update_page //回传函数(这里是函数名)
});
});
//ajax提交
$("#loading").ajaxStart(function(){
$(this).html("<img src=\"loader.gif\"> 正在加载");
});
//ajax结束状态
$("#loading").ajaxStop(function(){
$(this).hide();
});
});
function update_page (json ) { //回传函数实体,参数为XMLhttpRequest.responseText
var str= "ISBN="+json.ISBN + ",check:" + json.check + ",title="+json.title;
$("#bookHolder").html(str);
}
</script>
我這樣寫了,還是只能执行一次。。费解
作者: xuganggogo 发布时间: 2009-03-25
//ajax结束状态
$("#loading").ajaxStop(function(){
$(this).hide();
});
這裡我把這個层隐藏了,所以在怎么提交,也没有显示。
作者: xuganggogo 发布时间: 2009-03-25
//ajax结束状态
$("#loading").ajaxStop(function(){
$(this).hide();
});
這裡我把這個层隐藏了,所以在怎么提交,也没有显示。
正确的应该怎么写,我学习下
作者: zhq6648155 发布时间: 2009-03-31
作者: yonge 发布时间: 2009-04-15
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28