ajax方法的用法
发布时间:2020-12-16 03:34:50 所属栏目:百科 来源:网络整理
导读:$.ajax({ type : "POST" ,url : "test.do" ,data : text,async : false,dataType : "json" ,success : function(res) { aler("test"); },error : function(res) { },complete : function() { }}); dataType : "json" , 服务器端返回的数据格式 json格式 也可
$.ajax({ type : "POST",url : "test.do",data : text,async : false,dataType : "json",success : function(res) { aler("test"); },error : function(res) { },complete : function() { } });dataType : "json",服务器端返回的数据格式 json格式 也可以是text等类型async : false 默认是true false 表示为同步 什么意思呢? 意思就是要等test.do 完成后才会执行aler("test");这个操作 如果为true 的话就是还没执行完test.do 就执行aler("test"); 但是这个地方就说报错 因为没有返回值 或者说test.do执行出错了依然会执行 在test.do后面可以放通过以下方式存放数据:1:"${context_root}/bmbucbp1/bui570002.do?&cop_bus_typ=" + cop_bus_typ+"&old_jrn_no="+old_jrn_no+"&old_ord_no="+old_ord_no,2: 在data 里面放json格式的数据 data:{"applyNumber":applyNumber}, (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
推荐文章
站长推荐
热点阅读